home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / GCC-2.3.3r12 / Sources / optabs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-08  |  154.2 KB  |  5,392 lines  |  [TEXT/MPS ]

  1. /* Expand the basic unary and binary arithmetic operations, for GNU compiler.
  2.    Copyright (C) 1987, 1988, 1992 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. #include "config.h"
  22. #include "rtl.h"
  23. #include "tree.h"
  24. #include "flags.h"
  25. #include "insn-flags.h"
  26. #include "insn-codes.h"
  27. #include "expr.h"
  28. #include "insn-config.h"
  29. #include "recog.h"
  30. #include <ctype.h>
  31.  
  32. /* Each optab contains info on how this target machine
  33.    can perform a particular operation
  34.    for all sizes and kinds of operands.
  35.  
  36.    The operation to be performed is often specified
  37.    by passing one of these optabs as an argument.
  38.  
  39.    See expr.h for documentation of these optabs.  */
  40.  
  41. optab add_optab;
  42. optab sub_optab;
  43. optab smul_optab;
  44. optab smul_widen_optab;
  45. optab umul_widen_optab;
  46. optab sdiv_optab;
  47. optab sdivmod_optab;
  48. optab udiv_optab;
  49. optab udivmod_optab;
  50. optab smod_optab;
  51. optab umod_optab;
  52. optab flodiv_optab;
  53. optab ftrunc_optab;
  54. optab and_optab;
  55. optab ior_optab;
  56. optab xor_optab;
  57. optab ashl_optab;
  58. optab lshr_optab;
  59. optab lshl_optab;
  60. optab ashr_optab;
  61. optab rotl_optab;
  62. optab rotr_optab;
  63. optab smin_optab;
  64. optab smax_optab;
  65. optab umin_optab;
  66. optab umax_optab;
  67.  
  68. optab mov_optab;
  69. optab movstrict_optab;
  70.  
  71. optab neg_optab;
  72. optab abs_optab;
  73. optab one_cmpl_optab;
  74. optab ffs_optab;
  75. optab sqrt_optab;
  76. optab sin_optab;
  77. optab cos_optab;
  78. /* Add more (possibly unused) optables for assorted elementary functions. */
  79. optab tan_optab;
  80. optab asin_optab;
  81. optab acos_optab;
  82. optab atan_optab;
  83. optab sinh_optab;
  84. optab cosh_optab;
  85. optab tanh_optab;
  86. optab exp_optab;
  87. optab log_optab;
  88. optab log10_optab;
  89.  
  90. optab cmp_optab;
  91. optab ucmp_optab;  /* Used only for libcalls for unsigned comparisons.  */
  92. optab tst_optab;
  93.  
  94. optab strlen_optab;
  95.  
  96. /* SYMBOL_REF rtx's for the library functions that are called
  97.    implicitly and not via optabs.  */
  98.  
  99. rtx extendsfdf2_libfunc;
  100. rtx extendsfxf2_libfunc;
  101. rtx extendsftf2_libfunc;
  102. rtx extenddfxf2_libfunc;
  103. rtx extenddftf2_libfunc;
  104.  
  105. rtx truncdfsf2_libfunc;
  106. rtx truncxfsf2_libfunc;
  107. rtx trunctfsf2_libfunc;
  108. rtx truncxfdf2_libfunc;
  109. rtx trunctfdf2_libfunc;
  110.  
  111. rtx memcpy_libfunc;
  112. rtx bcopy_libfunc;
  113. rtx memcmp_libfunc;
  114. rtx bcmp_libfunc;
  115. rtx memset_libfunc;
  116. rtx bzero_libfunc;
  117.  
  118. rtx eqsf2_libfunc;
  119. rtx nesf2_libfunc;
  120. rtx gtsf2_libfunc;
  121. rtx gesf2_libfunc;
  122. rtx ltsf2_libfunc;
  123. rtx lesf2_libfunc;
  124.  
  125. rtx eqdf2_libfunc;
  126. rtx nedf2_libfunc;
  127. rtx gtdf2_libfunc;
  128. rtx gedf2_libfunc;
  129. rtx ltdf2_libfunc;
  130. rtx ledf2_libfunc;
  131.  
  132. rtx eqxf2_libfunc;
  133. rtx nexf2_libfunc;
  134. rtx gtxf2_libfunc;
  135. rtx gexf2_libfunc;
  136. rtx ltxf2_libfunc;
  137. rtx lexf2_libfunc;
  138.  
  139. rtx eqtf2_libfunc;
  140. rtx netf2_libfunc;
  141. rtx gttf2_libfunc;
  142. rtx getf2_libfunc;
  143. rtx lttf2_libfunc;
  144. rtx letf2_libfunc;
  145.  
  146. rtx floatsisf_libfunc;
  147. rtx floatdisf_libfunc;
  148. rtx floattisf_libfunc;
  149.  
  150. rtx floatsidf_libfunc;
  151. rtx floatdidf_libfunc;
  152. rtx floattidf_libfunc;
  153.  
  154. rtx floatsixf_libfunc;
  155. rtx floatdixf_libfunc;
  156. rtx floattixf_libfunc;
  157.  
  158. rtx floatsitf_libfunc;
  159. rtx floatditf_libfunc;
  160. rtx floattitf_libfunc;
  161.  
  162. rtx fixsfsi_libfunc;
  163. rtx fixsfdi_libfunc;
  164. rtx fixsfti_libfunc;
  165.  
  166. rtx fixdfsi_libfunc;
  167. rtx fixdfdi_libfunc;
  168. rtx fixdfti_libfunc;
  169.  
  170. rtx fixxfsi_libfunc;
  171. rtx fixxfdi_libfunc;
  172. rtx fixxfti_libfunc;
  173.  
  174. rtx fixtfsi_libfunc;
  175. rtx fixtfdi_libfunc;
  176. rtx fixtfti_libfunc;
  177.  
  178. rtx fixunssfsi_libfunc;
  179. rtx fixunssfdi_libfunc;
  180. rtx fixunssfti_libfunc;
  181.  
  182. rtx fixunsdfsi_libfunc;
  183. rtx fixunsdfdi_libfunc;
  184. rtx fixunsdfti_libfunc;
  185.  
  186. rtx fixunsxfsi_libfunc;
  187. rtx fixunsxfdi_libfunc;
  188. rtx fixunsxfti_libfunc;
  189.  
  190. rtx fixunstfsi_libfunc;
  191. rtx fixunstfdi_libfunc;
  192. rtx fixunstfti_libfunc;
  193.  
  194. /* from emit-rtl.c */
  195. extern rtx gen_highpart ();
  196.  
  197. /* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
  198.    gives the gen_function to make a branch to test that condition.  */
  199.  
  200. rtxfun bcc_gen_fctn[NUM_RTX_CODE];
  201.  
  202. /* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
  203.    gives the insn code to make a store-condition insn
  204.    to test that condition.  */
  205.  
  206. enum insn_code setcc_gen_code[NUM_RTX_CODE];
  207.  
  208. static void emit_float_lib_cmp ();
  209.  
  210. /* Add a REG_EQUAL note to the last insn in SEQ.  TARGET is being set to
  211.    the result of operation CODE applied to OP0 (and OP1 if it is a binary
  212.    operation).
  213.  
  214.    If the last insn does not set TARGET, don't do anything, but return 1.
  215.  
  216.    If a previous insn sets TARGET and TARGET is one of OP0 or OP1,
  217.    don't add the REG_EQUAL note but return 0.  Our caller can then try
  218.    again, ensuring that TARGET is not one of the operands.  */
  219.  
  220. static int
  221. add_equal_note (seq, target, code, op0, op1)
  222.      rtx seq;
  223.      rtx target;
  224.      enum rtx_code code;
  225.      rtx op0, op1;
  226. {
  227.   rtx set;
  228.   int i;
  229.   rtx note;
  230.  
  231.   if ((GET_RTX_CLASS (code) != '1' && GET_RTX_CLASS (code) != '2'
  232.        && GET_RTX_CLASS (code) != 'c' && GET_RTX_CLASS (code) != '<')
  233.       || GET_CODE (seq) != SEQUENCE
  234.       || (set = single_set (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1))) == 0
  235.       || GET_CODE (target) == ZERO_EXTRACT
  236.       || (! rtx_equal_p (SET_DEST (set), target)
  237.       /* For a STRICT_LOW_PART, the REG_NOTE applies to what is inside the
  238.          SUBREG.  */
  239.       && (GET_CODE (SET_DEST (set)) != STRICT_LOW_PART
  240.           || ! rtx_equal_p (SUBREG_REG (XEXP (SET_DEST (set), 0)),
  241.                 target))))
  242.     return 1;
  243.  
  244.   /* If TARGET is in OP0 or OP1, check if anything in SEQ sets TARGET
  245.      besides the last insn.  */
  246.   if (reg_overlap_mentioned_p (target, op0)
  247.       || (op1 && reg_overlap_mentioned_p (target, op1)))
  248.     for (i = XVECLEN (seq, 0) - 2; i >= 0; i--)
  249.       if (reg_set_p (target, XVECEXP (seq, 0, i)))
  250.     return 0;
  251.  
  252.   if (GET_RTX_CLASS (code) == '1')
  253.     note = gen_rtx (code, GET_MODE (target), op0);
  254.   else
  255.     note = gen_rtx (code, GET_MODE (target), op0, op1);
  256.  
  257.   REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1))
  258.     = gen_rtx (EXPR_LIST, REG_EQUAL, note,
  259.            REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1)));
  260.  
  261.   return 1;
  262. }
  263.  
  264. /* Generate code to perform an operation specified by BINOPTAB
  265.    on operands OP0 and OP1, with result having machine-mode MODE.
  266.  
  267.    UNSIGNEDP is for the case where we have to widen the operands
  268.    to perform the operation.  It says to use zero-extension.
  269.  
  270.    If TARGET is nonzero, the value
  271.    is generated there, if it is convenient to do so.
  272.    In all cases an rtx is returned for the locus of the value;
  273.    this may or may not be TARGET.  */
  274.  
  275. rtx
  276. expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
  277.      enum machine_mode mode;
  278.      optab binoptab;
  279.      rtx op0, op1;
  280.      rtx target;
  281.      int unsignedp;
  282.      enum optab_methods methods;
  283. {
  284.   enum mode_class class;
  285.   enum machine_mode wider_mode;
  286.   register rtx temp;
  287.   int commutative_op = 0;
  288.   int shift_op = (binoptab->code ==  ASHIFT
  289.           || binoptab->code == ASHIFTRT
  290.           || binoptab->code == LSHIFT
  291.           || binoptab->code == LSHIFTRT
  292.           || binoptab->code == ROTATE
  293.           || binoptab->code == ROTATERT);
  294.   rtx entry_last = get_last_insn ();
  295.   rtx last;
  296.  
  297.   class = GET_MODE_CLASS (mode);
  298.  
  299.   op0 = protect_from_queue (op0, 0);
  300.   op1 = protect_from_queue (op1, 0);
  301.   if (target)
  302.     target = protect_from_queue (target, 1);
  303.  
  304.   if (flag_force_mem)
  305.     {
  306.       op0 = force_not_mem (op0);
  307.       op1 = force_not_mem (op1);
  308.     }
  309.  
  310.   /* If subtracting an integer constant, convert this into an addition of
  311.      the negated constant.  */
  312.  
  313.   if (binoptab == sub_optab && GET_CODE (op1) == CONST_INT)
  314.     {
  315.       op1 = negate_rtx (mode, op1);
  316.       binoptab = add_optab;
  317.     }
  318.  
  319.   /* If we are inside an appropriately-short loop and one operand is an
  320.      expensive constant, force it into a register.  */
  321.   if (CONSTANT_P (op0) && preserve_subexpressions_p ()
  322.       && rtx_cost (op0, binoptab->code) > 2)
  323.     op0 = force_reg (mode, op0);
  324.  
  325.   if (CONSTANT_P (op1) && preserve_subexpressions_p ()
  326.       && rtx_cost (op1, binoptab->code) > 2)
  327.     op1 = force_reg (shift_op ? word_mode : mode, op1);
  328.  
  329.   /* Record where to delete back to if we backtrack.  */
  330.   last = get_last_insn ();
  331.  
  332.   /* If operation is commutative,
  333.      try to make the first operand a register.
  334.      Even better, try to make it the same as the target.
  335.      Also try to make the last operand a constant.  */
  336.   if (GET_RTX_CLASS (binoptab->code) == 'c'
  337.       || binoptab == smul_widen_optab
  338.       || binoptab == umul_widen_optab)
  339.     {
  340.       commutative_op = 1;
  341.  
  342.       if (((target == 0 || GET_CODE (target) == REG)
  343.        ? ((GET_CODE (op1) == REG
  344.            && GET_CODE (op0) != REG)
  345.           || target == op1)
  346.        : rtx_equal_p (op1, target))
  347.       || GET_CODE (op0) == CONST_INT)
  348.     {
  349.       temp = op1;
  350.       op1 = op0;
  351.       op0 = temp;
  352.     }
  353.     }
  354.  
  355.   /* If we can do it with a three-operand insn, do so.  */
  356.  
  357.   if (methods != OPTAB_MUST_WIDEN
  358.       && binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  359.     {
  360.       int icode = (int) binoptab->handlers[(int) mode].insn_code;
  361.       enum machine_mode mode0 = insn_operand_mode[icode][1];
  362.       enum machine_mode mode1 = insn_operand_mode[icode][2];
  363.       rtx pat;
  364.       rtx xop0 = op0, xop1 = op1;
  365.  
  366.       if (target)
  367.     temp = target;
  368.       else
  369.     temp = gen_reg_rtx (mode);
  370.  
  371.       /* If it is a commutative operator and the modes would match
  372.      if we would swap the operands, we can save the conversions. */
  373.       if (commutative_op)
  374.     {
  375.       if (GET_MODE (op0) != mode0 && GET_MODE (op1) != mode1
  376.           && GET_MODE (op0) == mode1 && GET_MODE (op1) == mode0)
  377.         {
  378.           register rtx tmp;
  379.  
  380.           tmp = op0; op0 = op1; op1 = tmp;
  381.           tmp = xop0; xop0 = xop1; xop1 = tmp;
  382.         }
  383.     }
  384.  
  385.       /* In case the insn wants input operands in modes different from
  386.      the result, convert the operands.  */
  387.  
  388.       if (GET_MODE (op0) != VOIDmode
  389.       && GET_MODE (op0) != mode0)
  390.     xop0 = convert_to_mode (mode0, xop0, unsignedp);
  391.  
  392.       if (GET_MODE (xop1) != VOIDmode
  393.       && GET_MODE (xop1) != mode1)
  394.     xop1 = convert_to_mode (mode1, xop1, unsignedp);
  395.  
  396.       /* Now, if insn's predicates don't allow our operands, put them into
  397.      pseudo regs.  */
  398.  
  399.       if (! (*insn_operand_predicate[icode][1]) (xop0, mode0))
  400.     xop0 = copy_to_mode_reg (mode0, xop0);
  401.  
  402.       if (! (*insn_operand_predicate[icode][2]) (xop1, mode1))
  403.     xop1 = copy_to_mode_reg (mode1, xop1);
  404.  
  405.       if (! (*insn_operand_predicate[icode][0]) (temp, mode))
  406.     temp = gen_reg_rtx (mode);
  407.  
  408.       pat = GEN_FCN (icode) (temp, xop0, xop1);
  409.       if (pat)
  410.     {
  411.       /* If PAT is a multi-insn sequence, try to add an appropriate
  412.          REG_EQUAL note to it.  If we can't because TEMP conflicts with an
  413.          operand, call ourselves again, this time without a target.  */
  414.       if (GET_CODE (pat) == SEQUENCE
  415.           && ! add_equal_note (pat, temp, binoptab->code, xop0, xop1))
  416.         {
  417.           delete_insns_since (last);
  418.           return expand_binop (mode, binoptab, op0, op1, NULL_RTX,
  419.                    unsignedp, methods);
  420.         }
  421.  
  422.       emit_insn (pat);
  423.       return temp;
  424.     }
  425.       else
  426.     delete_insns_since (last);
  427.     }
  428.  
  429.   /* If this is a multiply, see if we can do a widening operation that
  430.      takes operands of this mode and makes a wider mode.  */
  431.  
  432.   if (binoptab == smul_optab && GET_MODE_WIDER_MODE (mode) != VOIDmode
  433.       && (((unsignedp ? umul_widen_optab : smul_widen_optab)
  434.        ->handlers[(int) GET_MODE_WIDER_MODE (mode)].insn_code)
  435.       != CODE_FOR_nothing))
  436.     {
  437.       temp = expand_binop (GET_MODE_WIDER_MODE (mode),
  438.                unsignedp ? umul_widen_optab : smul_widen_optab,
  439.                op0, op1, 0, unsignedp, OPTAB_DIRECT);
  440.  
  441.       if (GET_MODE_CLASS (mode) == MODE_INT)
  442.     return gen_lowpart (mode, temp);
  443.       else
  444.     return convert_to_mode (mode, temp, unsignedp);
  445.     }
  446.  
  447.   /* Look for a wider mode of the same class for which we think we
  448.      can open-code the operation.  Check for a widening multiply at the
  449.      wider mode as well.  */
  450.  
  451.   if ((class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
  452.       && methods != OPTAB_DIRECT && methods != OPTAB_LIB)
  453.     for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  454.      wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  455.       {
  456.     if (binoptab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing
  457.         || (binoptab == smul_optab
  458.         && GET_MODE_WIDER_MODE (wider_mode) != VOIDmode
  459.         && (((unsignedp ? umul_widen_optab : smul_widen_optab)
  460.              ->handlers[(int) GET_MODE_WIDER_MODE (wider_mode)].insn_code)
  461.             != CODE_FOR_nothing)))
  462.       {
  463.         rtx xop0 = op0, xop1 = op1;
  464.         int no_extend = 0;
  465.  
  466.         /* For certain integer operations, we need not actually extend
  467.            the narrow operands, as long as we will truncate
  468.            the results to the same narrowness.  Don't do this when
  469.            WIDER_MODE is wider than a word since a paradoxical SUBREG
  470.            isn't valid for such modes.  */
  471.  
  472.         if ((binoptab == ior_optab || binoptab == and_optab
  473.          || binoptab == xor_optab
  474.          || binoptab == add_optab || binoptab == sub_optab
  475.          || binoptab == smul_optab
  476.          || binoptab == ashl_optab || binoptab == lshl_optab)
  477.         && class == MODE_INT
  478.         && GET_MODE_SIZE (wider_mode) <= UNITS_PER_WORD)
  479.           no_extend = 1;
  480.  
  481.         /* If an operand is a constant integer, we might as well
  482.            convert it since that is more efficient than using a SUBREG,
  483.            unlike the case for other operands.  Similarly for
  484.            SUBREGs that were made due to promoted objects.  */
  485.  
  486.         if (no_extend && GET_MODE (xop0) != VOIDmode
  487.         && ! (GET_CODE (xop0) == SUBREG
  488.               && SUBREG_PROMOTED_VAR_P (xop0)))
  489.           xop0 = gen_rtx (SUBREG, wider_mode,
  490.                   force_reg (GET_MODE (xop0), xop0), 0);
  491.         else
  492.           xop0 = convert_to_mode (wider_mode, xop0, unsignedp);
  493.  
  494.         if (no_extend && GET_MODE (xop1) != VOIDmode
  495.         && ! (GET_CODE (xop1) == SUBREG
  496.               && SUBREG_PROMOTED_VAR_P (xop1)))
  497.           xop1 = gen_rtx (SUBREG, wider_mode,
  498.                 force_reg (GET_MODE (xop1), xop1), 0);
  499.         else
  500.           xop1 = convert_to_mode (wider_mode, xop1, unsignedp);
  501.  
  502.         temp = expand_binop (wider_mode, binoptab, xop0, xop1, NULL_RTX,
  503.                  unsignedp, OPTAB_DIRECT);
  504.         if (temp)
  505.           {
  506.         if (class != MODE_INT)
  507.           {
  508.             if (target == 0)
  509.               target = gen_reg_rtx (mode);
  510.             convert_move (target, temp, 0);
  511.             return target;
  512.           }
  513.         else
  514.           return gen_lowpart (mode, temp);
  515.           }
  516.         else
  517.           delete_insns_since (last);
  518.       }
  519.       }
  520.  
  521.   /* These can be done a word at a time.  */
  522.   if ((binoptab == and_optab || binoptab == ior_optab || binoptab == xor_optab)
  523.       && class == MODE_INT
  524.       && GET_MODE_SIZE (mode) > UNITS_PER_WORD
  525.       && binoptab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
  526.     {
  527.       int i;
  528.       rtx insns;
  529.       rtx equiv_value;
  530.  
  531.       /* If TARGET is the same as one of the operands, the REG_EQUAL note
  532.      won't be accurate, so use a new target.  */
  533.       if (target == 0 || target == op0 || target == op1)
  534.     target = gen_reg_rtx (mode);
  535.  
  536.       start_sequence ();
  537.  
  538.       /* Do the actual arithmetic.  */
  539.       for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
  540.     {
  541.       rtx target_piece = operand_subword (target, i, 1, mode);
  542.       rtx x = expand_binop (word_mode, binoptab,
  543.                 operand_subword_force (op0, i, mode),
  544.                 operand_subword_force (op1, i, mode),
  545.                 target_piece, unsignedp, methods);
  546.       if (target_piece != x)
  547.         emit_move_insn (target_piece, x);
  548.     }
  549.  
  550.       insns = get_insns ();
  551.       end_sequence ();
  552.  
  553.       if (binoptab->code != UNKNOWN)
  554.     equiv_value = gen_rtx (binoptab->code, mode, op0, op1);
  555.       else
  556.     equiv_value = 0;
  557.  
  558.       emit_no_conflict_block (insns, target, op0, op1, equiv_value);
  559.       return target;
  560.     }
  561.  
  562.   /* These can be done a word at a time by propagating carries.  */
  563.   if ((binoptab == add_optab || binoptab == sub_optab)
  564.       && class == MODE_INT
  565.       && GET_MODE_SIZE (mode) >= 2 * UNITS_PER_WORD
  566.       && binoptab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
  567.     {
  568.       int i;
  569.       rtx carry_tmp = gen_reg_rtx (word_mode);
  570.       optab otheroptab = binoptab == add_optab ? sub_optab : add_optab;
  571.       int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
  572.       rtx carry_in, carry_out;
  573.       rtx xop0, xop1;
  574.  
  575.       /* We can handle either a 1 or -1 value for the carry.  If STORE_FLAG
  576.      value is one of those, use it.  Otherwise, use 1 since it is the
  577.      one easiest to get.  */
  578. #if STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1
  579.       int normalizep = STORE_FLAG_VALUE;
  580. #else
  581.       int normalizep = 1;
  582. #endif
  583.  
  584.       /* Prepare the operands.  */
  585.       xop0 = force_reg (mode, op0);
  586.       xop1 = force_reg (mode, op1);
  587.  
  588.       if (target == 0 || GET_CODE (target) != REG
  589.       || target == xop0 || target == xop1)
  590.     target = gen_reg_rtx (mode);
  591.  
  592.       /* Do the actual arithmetic.  */
  593.       for (i = 0; i < nwords; i++)
  594.     {
  595.       int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i);
  596.       rtx target_piece = operand_subword (target, index, 1, mode);
  597.       rtx op0_piece = operand_subword_force (xop0, index, mode);
  598.       rtx op1_piece = operand_subword_force (xop1, index, mode);
  599.       rtx x;
  600.  
  601.       /* Main add/subtract of the input operands.  */
  602.       x = expand_binop (word_mode, binoptab,
  603.                 op0_piece, op1_piece,
  604.                 target_piece, unsignedp, methods);
  605.       if (x == 0)
  606.         break;
  607.  
  608.       if (i + 1 < nwords)
  609.         {
  610.           /* Store carry from main add/subtract.  */
  611.           carry_out = gen_reg_rtx (word_mode);
  612.           carry_out = emit_store_flag (carry_out,
  613.                        binoptab == add_optab ? LTU : GTU,
  614.                        x, op0_piece,
  615.                        word_mode, 1, normalizep);
  616.           if (!carry_out)
  617.         break;
  618.         }
  619.  
  620.       if (i > 0)
  621.         {
  622.           /* Add/subtract previous carry to main result.  */
  623.           x = expand_binop (word_mode,
  624.                 normalizep == 1 ? binoptab : otheroptab,
  625.                 x, carry_in,
  626.                 target_piece, 1, methods);
  627.           if (target_piece != x)
  628.         emit_move_insn (target_piece, x);
  629.  
  630.           if (i + 1 < nwords)
  631.         {
  632.           /* THIS CODE HAS NOT BEEN TESTED.  */
  633.           /* Get out carry from adding/subtracting carry in.  */
  634.           carry_tmp = emit_store_flag (carry_tmp,
  635.                            binoptab == add_optab
  636.                              ? LTU : GTU,
  637.                            x, carry_in,
  638.                            word_mode, 1, normalizep);
  639.           /* Logical-ior the two poss. carry together.  */
  640.           carry_out = expand_binop (word_mode, ior_optab,
  641.                         carry_out, carry_tmp,
  642.                         carry_out, 0, methods);
  643.           if (!carry_out)
  644.             break;
  645.         }
  646.         }
  647.  
  648.       carry_in = carry_out;
  649.     }    
  650.  
  651.       if (i == GET_MODE_BITSIZE (mode) / BITS_PER_WORD)
  652.     {
  653.       rtx temp;
  654.       
  655.       temp = emit_move_insn (target, target);
  656.       REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL,
  657.                       gen_rtx (binoptab->code, mode, xop0, xop1),
  658.                       REG_NOTES (temp));
  659.       return target;
  660.     }
  661.       else
  662.     delete_insns_since (last);
  663.     }
  664.  
  665.   /* If we want to multiply two two-word values and have normal and widening
  666.      multiplies of single-word values, we can do this with three smaller
  667.      multiplications.  Note that we do not make a REG_NO_CONFLICT block here
  668.      because we are not operating on one word at a time. 
  669.  
  670.      The multiplication proceeds as follows:
  671.                      _______________________
  672.                     [__op0_high_|__op0_low__]
  673.                      _______________________
  674.         *                [__op1_high_|__op1_low__]
  675.         _______________________________________________
  676.                      _______________________
  677.     (1)                [__op0_low__*__op1_low__]
  678.              _______________________
  679.     (2a)        [__op0_low__*__op1_high_]
  680.              _______________________
  681.     (2b)        [__op0_high_*__op1_low__]
  682.          _______________________
  683.     (3) [__op0_high_*__op1_high_]
  684.  
  685.  
  686.     This gives a 4-word result.  Since we are only interested in the
  687.     lower 2 words, partial result (3) and the upper words of (2a) and
  688.     (2b) don't need to be calculated.  Hence (2a) and (2b) can be
  689.     calculated using non-widening multiplication.
  690.  
  691.     (1), however, needs to be calculated with an unsigned widening
  692.     multiplication.  If this operation is not directly supported we
  693.     try using a signed widening multiplication and adjust the result.
  694.     This adjustment works as follows:
  695.  
  696.       If both operands are positive then no adjustment is needed.
  697.  
  698.       If the operands have different signs, for example op0_low < 0 and
  699.       op1_low >= 0, the instruction treats the most significant bit of
  700.       op0_low as a sign bit instead of a bit with significance
  701.       2**(BITS_PER_WORD-1), i.e. the instruction multiplies op1_low
  702.       with 2**BITS_PER_WORD - op0_low, and two's complements the
  703.       result.  Conclusion: We need to add op1_low * 2**BITS_PER_WORD to
  704.       the result.
  705.  
  706.       Similarly, if both operands are negative, we need to add
  707.       (op0_low + op1_low) * 2**BITS_PER_WORD.
  708.  
  709.       We use a trick to adjust quickly.  We logically shift op0_low right
  710.       (op1_low) BITS_PER_WORD-1 steps to get 0 or 1, and add this to
  711.       op0_high (op1_high) before it is used to calculate 2b (2a).  If no
  712.       logical shift exists, we do an arithmetic right shift and subtract
  713.       the 0 or -1.  */
  714.  
  715.   if (binoptab == smul_optab
  716.       && class == MODE_INT
  717.       && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
  718.       && smul_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
  719.       && add_optab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing
  720.       && ((umul_widen_optab->handlers[(int) mode].insn_code
  721.        != CODE_FOR_nothing)
  722.       || (smul_widen_optab->handlers[(int) mode].insn_code
  723.           != CODE_FOR_nothing)))
  724.     {
  725.       int low = (WORDS_BIG_ENDIAN ? 1 : 0);
  726.       int high = (WORDS_BIG_ENDIAN ? 0 : 1);
  727.       rtx op0_high = operand_subword_force (op0, high, mode);
  728.       rtx op0_low = operand_subword_force (op0, low, mode);
  729.       rtx op1_high = operand_subword_force (op1, high, mode);
  730.       rtx op1_low = operand_subword_force (op1, low, mode);
  731.       rtx product = 0;
  732.       rtx op0_xhigh;
  733.       rtx op1_xhigh;
  734.  
  735.       /* If the target is the same as one of the inputs, don't use it.  This
  736.      prevents problems with the REG_EQUAL note.  */
  737.       if (target == op0 || target == op1)
  738.     target = 0;
  739.  
  740.       /* Multiply the two lower words to get a double-word product.
  741.      If unsigned widening multiplication is available, use that;
  742.      otherwise use the signed form and compensate.  */
  743.  
  744.       if (umul_widen_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  745.     {
  746.       product = expand_binop (mode, umul_widen_optab, op0_low, op1_low,
  747.                   target, 1, OPTAB_DIRECT);
  748.  
  749.       /* If we didn't succeed, delete everything we did so far.  */
  750.       if (product == 0)
  751.         delete_insns_since (last);
  752.       else
  753.         op0_xhigh = op0_high, op1_xhigh = op1_high;
  754.     }
  755.  
  756.       if (product == 0
  757.       && smul_widen_optab->handlers[(int) mode].insn_code
  758.            != CODE_FOR_nothing)
  759.     {
  760.       rtx wordm1 = GEN_INT (BITS_PER_WORD - 1);
  761.       product = expand_binop (mode, smul_widen_optab, op0_low, op1_low,
  762.                   target, 1, OPTAB_DIRECT);
  763.       op0_xhigh = expand_binop (word_mode, lshr_optab, op0_low, wordm1,
  764.                     NULL_RTX, 1, OPTAB_DIRECT);
  765.       if (op0_xhigh)
  766.         op0_xhigh = expand_binop (word_mode, add_optab, op0_high,
  767.                       op0_xhigh, op0_xhigh, 0, OPTAB_DIRECT);
  768.       else
  769.         {
  770.           op0_xhigh = expand_binop (word_mode, ashr_optab, op0_low, wordm1,
  771.                     NULL_RTX, 0, OPTAB_DIRECT);
  772.           if (op0_xhigh)
  773.         op0_xhigh = expand_binop (word_mode, sub_optab, op0_high,
  774.                       op0_xhigh, op0_xhigh, 0,
  775.                       OPTAB_DIRECT);
  776.         }
  777.  
  778.       op1_xhigh = expand_binop (word_mode, lshr_optab, op1_low, wordm1,
  779.                     NULL_RTX, 1, OPTAB_DIRECT);
  780.       if (op1_xhigh)
  781.         op1_xhigh = expand_binop (word_mode, add_optab, op1_high,
  782.                       op1_xhigh, op1_xhigh, 0, OPTAB_DIRECT);
  783.       else
  784.         {
  785.           op1_xhigh = expand_binop (word_mode, ashr_optab, op1_low, wordm1,
  786.                     NULL_RTX, 0, OPTAB_DIRECT);
  787.           if (op1_xhigh)
  788.         op1_xhigh = expand_binop (word_mode, sub_optab, op1_high,
  789.                       op1_xhigh, op1_xhigh, 0,
  790.                       OPTAB_DIRECT);
  791.         }
  792.     }
  793.  
  794.       /* If we have been able to directly compute the product of the
  795.      low-order words of the operands and perform any required adjustments
  796.      of the operands, we proceed by trying two more multiplications
  797.      and then computing the appropriate sum.
  798.  
  799.      We have checked above that the required addition is provided.
  800.      Full-word addition will normally always succeed, especially if
  801.      it is provided at all, so we don't worry about its failure.  The
  802.      multiplication may well fail, however, so we do handle that.  */
  803.  
  804.       if (product && op0_xhigh && op1_xhigh)
  805.     {
  806.       rtx product_piece;
  807.       rtx product_high = operand_subword (product, high, 1, mode);
  808.       rtx temp = expand_binop (word_mode, binoptab, op0_low, op1_xhigh,
  809.                    NULL_RTX, 0, OPTAB_DIRECT);
  810.  
  811.       if (temp)
  812.         {
  813.           product_piece = expand_binop (word_mode, add_optab, temp,
  814.                         product_high, product_high,
  815.                         0, OPTAB_LIB_WIDEN);
  816.           if (product_piece != product_high)
  817.         emit_move_insn (product_high, product_piece);
  818.  
  819.           temp = expand_binop (word_mode, binoptab, op1_low, op0_xhigh, 
  820.                    NULL_RTX, 0, OPTAB_DIRECT);
  821.  
  822.           product_piece = expand_binop (word_mode, add_optab, temp,
  823.                         product_high, product_high,
  824.                         0, OPTAB_LIB_WIDEN);
  825.           if (product_piece != product_high)
  826.         emit_move_insn (product_high, product_piece);
  827.  
  828.           temp = emit_move_insn (product, product);
  829.           REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL,
  830.                       gen_rtx (MULT, mode, op0, op1),
  831.                       REG_NOTES (temp));
  832.  
  833.           return product;
  834.         }
  835.     }
  836.  
  837.       /* If we get here, we couldn't do it for some reason even though we
  838.      originally thought we could.  Delete anything we've emitted in
  839.      trying to do it.  */
  840.  
  841.       delete_insns_since (last);
  842.     }
  843.  
  844.   /* We need to open-code the complex type operations: '+, -, * and /' */
  845.  
  846.   /* At this point we allow operations between two similar complex
  847.      numbers, and also if one of the operands is not a complex number
  848.      but rather of MODE_FLOAT or MODE_INT. However, the caller
  849.      must make sure that the MODE of the non-complex operand matches
  850.      the SUBMODE of the complex operand.  */
  851.  
  852.   if (class == MODE_COMPLEX_FLOAT || class == MODE_COMPLEX_INT)
  853.     {
  854.       rtx real0 = (rtx) 0;
  855.       rtx imag0 = (rtx) 0;
  856.       rtx real1 = (rtx) 0;
  857.       rtx imag1 = (rtx) 0;
  858.       rtx realr;
  859.       rtx imagr;
  860.       rtx res;
  861.       rtx seq;
  862.       rtx equiv_value;
  863.  
  864.       /* Find the correct mode for the real and imaginary parts */
  865.       enum machine_mode submode
  866.     = mode_for_size (GET_MODE_UNIT_SIZE (mode) * BITS_PER_UNIT,
  867.              class == MODE_COMPLEX_INT ? MODE_INT : MODE_FLOAT,
  868.              0);
  869.  
  870.       if (submode == BLKmode)
  871.     abort ();
  872.  
  873.       if (! target)
  874.     target = gen_reg_rtx (mode);
  875.  
  876.       start_sequence ();
  877.  
  878.       realr = gen_realpart  (submode, target);
  879.       imagr = gen_imagpart (submode, target);
  880.  
  881.       if (GET_MODE (op0) == mode)
  882.     {
  883.       real0 = gen_realpart  (submode, op0);
  884.       imag0 = gen_imagpart (submode, op0);
  885.     }
  886.       else
  887.     real0 = op0;
  888.  
  889.       if (GET_MODE (op1) == mode)
  890.     {
  891.       real1 = gen_realpart  (submode, op1);
  892.       imag1 = gen_imagpart (submode, op1);
  893.     }
  894.       else
  895.     real1 = op1;
  896.  
  897.       if (! real0 || ! real1 || ! (imag0 || imag1))
  898.     abort ();
  899.  
  900.       switch (binoptab->code)
  901.     {
  902.     case PLUS:
  903.     case MINUS:
  904.       res = expand_binop (submode, binoptab, real0, real1,
  905.                   realr, unsignedp, methods);
  906.       if (res != realr)
  907.         emit_move_insn (realr, res);
  908.  
  909.       if (imag0 && imag1)
  910.         res = expand_binop (submode, binoptab, imag0, imag1,
  911.                 imagr, unsignedp, methods);
  912.       else if (imag0)
  913.         res = imag0;
  914.       else if (binoptab->code == MINUS)
  915.         res = expand_unop (submode, neg_optab, imag1, imagr, unsignedp);
  916.       else
  917.         res = imag1;
  918.  
  919.       if (res != imagr)
  920.         emit_move_insn (imagr, res);
  921.       break;
  922.  
  923.     case MULT:
  924.       /* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */
  925.  
  926.       res = expand_binop (submode, binoptab, real0, real1,
  927.                   realr, unsignedp, methods);
  928.  
  929.       if (imag0 && imag1)
  930.         {
  931.           rtx temp =
  932.         expand_binop (submode, sub_optab, res,
  933.                   expand_binop (submode, binoptab, imag0, imag1,
  934.                         0, unsignedp, methods),
  935.                   realr, unsignedp, methods);
  936.  
  937.           if (temp != realr)
  938.         emit_move_insn (realr, temp);
  939.  
  940.           res = expand_binop (submode, add_optab,
  941.                   expand_binop (submode, binoptab,
  942.                         real0, imag1,
  943.                         0, unsignedp, methods),
  944.                   expand_binop (submode, binoptab,
  945.                         real1, imag0,
  946.                         0, unsignedp, methods),
  947.                   imagr, unsignedp, methods);
  948.           if (res != imagr)
  949.         emit_move_insn (imagr, res);
  950.         }
  951.       else
  952.         {
  953.           if (res != realr)
  954.         emit_move_insn (realr, res);
  955.  
  956.           if (imag0)
  957.         res = expand_binop (submode, binoptab,
  958.                     real1, imag0, imagr, unsignedp, methods);
  959.           else
  960.         res = expand_binop (submode, binoptab,
  961.                     real0, imag1, imagr, unsignedp, methods);
  962.           if (res != imagr)
  963.         emit_move_insn (imagr, res);
  964.         }
  965.       break;
  966.  
  967.     case DIV:
  968.       /* (c+id)/(a+ib) == ((c+id)*(a-ib))/(a*a+b*b) */
  969.       
  970.       if (! imag1)
  971.         {
  972.           /* Simply divide the real and imaginary parts by `a' */
  973.           res = expand_binop (submode, binoptab, real0, real1,
  974.                   realr, unsignedp, methods);
  975.           if (res != realr)
  976.         emit_move_insn (realr, res);
  977.  
  978.           res = expand_binop (submode, binoptab, imag0, real1,
  979.                   imagr, unsignedp, methods);
  980.           if (res != imagr)
  981.         emit_move_insn (imagr, res);
  982.         }
  983.       else            /* Divisor is of complex type */
  984.         {            /* X/(a+ib) */
  985.  
  986.           rtx divisor;
  987.           rtx real_t;
  988.           rtx imag_t;
  989.           
  990.           optab mulopt = unsignedp ? umul_widen_optab : smul_optab;
  991.  
  992.           /* Divisor: c*c + d*d */
  993.           divisor = expand_binop (submode, add_optab,
  994.                       expand_binop (submode, mulopt,
  995.                             real1, real1,
  996.                             0, unsignedp, methods),
  997.                       expand_binop (submode, mulopt,
  998.                             imag1, imag1,
  999.                             0, unsignedp, methods),
  1000.                       0, unsignedp, methods);
  1001.  
  1002.           if (! imag0)    /* ((a)(c-id))/divisor */
  1003.         {    /* (a+i0) / (c+id) = (ac/(cc+dd)) + i(-ad/(cc+dd)) */
  1004.           /* Calculate the dividend */
  1005.           real_t = expand_binop (submode, mulopt, real0, real1,
  1006.                      0, unsignedp, methods);
  1007.           
  1008.           imag_t
  1009.             = expand_unop (submode, neg_optab,
  1010.                    expand_binop (submode, mulopt, real0, imag1,
  1011.                          0, unsignedp, methods),
  1012.                    0, unsignedp);
  1013.         }
  1014.           else        /* ((a+ib)(c-id))/divider */
  1015.         {
  1016.           /* Calculate the dividend */
  1017.           real_t = expand_binop (submode, add_optab,
  1018.                      expand_binop (submode, mulopt,
  1019.                                real0, real1,
  1020.                                0, unsignedp, methods),
  1021.                      expand_binop (submode, mulopt,
  1022.                                imag0, imag1,
  1023.                                0, unsignedp, methods),
  1024.                      0, unsignedp, methods);
  1025.           
  1026.           imag_t = expand_binop (submode, sub_optab,
  1027.                      expand_binop (submode, mulopt,
  1028.                                imag0, real1,
  1029.                                0, unsignedp, methods),
  1030.                      expand_binop (submode, mulopt,
  1031.                                real0, imag1,
  1032.                                0, unsignedp, methods),
  1033.                      0, unsignedp, methods);
  1034.  
  1035.         }
  1036.  
  1037.           res = expand_binop (submode, binoptab, real_t, divisor,
  1038.                   realr, unsignedp, methods);
  1039.           if (res != realr)
  1040.         emit_move_insn (realr, res);
  1041.  
  1042.           res = expand_binop (submode, binoptab, imag_t, divisor,
  1043.                   imagr, unsignedp, methods);
  1044.           if (res != imagr)
  1045.         emit_move_insn (imagr, res);
  1046.         }
  1047.       break;
  1048.       
  1049.     default:
  1050.       abort ();
  1051.     }
  1052.  
  1053.       seq = get_insns ();
  1054.       end_sequence ();
  1055.  
  1056.       if (binoptab->code != UNKNOWN)
  1057.     equiv_value = gen_rtx (binoptab->code, mode, op0, op1);
  1058.       else
  1059.     equiv_value = 0;
  1060.       
  1061.       emit_no_conflict_block (seq, target, op0, op1, equiv_value);
  1062.       
  1063.       return target;
  1064.     }
  1065.  
  1066.   /* It can't be open-coded in this mode.
  1067.      Use a library call if one is available and caller says that's ok.  */
  1068.  
  1069.   if (binoptab->handlers[(int) mode].libfunc
  1070.       && (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN))
  1071.     {
  1072.       rtx insns;
  1073.       rtx funexp = binoptab->handlers[(int) mode].libfunc;
  1074.       rtx op1x = op1;
  1075.       enum machine_mode op1_mode = mode;
  1076.  
  1077.       start_sequence ();
  1078.  
  1079.       if (shift_op)
  1080.     {
  1081.       op1_mode = word_mode;
  1082.       /* Specify unsigned here,
  1083.          since negative shift counts are meaningless.  */
  1084.       op1x = convert_to_mode (word_mode, op1, 1);
  1085.     }
  1086.  
  1087.       /* Pass 1 for NO_QUEUE so we don't lose any increments
  1088.      if the libcall is cse'd or moved.  */
  1089.       emit_library_call (binoptab->handlers[(int) mode].libfunc,
  1090.              1, mode, 2, op0, mode, op1x, op1_mode);
  1091.  
  1092.       insns = get_insns ();
  1093.       end_sequence ();
  1094.  
  1095.       target = gen_reg_rtx (mode);
  1096.       emit_libcall_block (insns, target, hard_libcall_value (mode),
  1097.               gen_rtx (binoptab->code, mode, op0, op1));
  1098.  
  1099.       return target;
  1100.     }
  1101.  
  1102.   delete_insns_since (last);
  1103.  
  1104.   /* It can't be done in this mode.  Can we do it in a wider mode?  */
  1105.  
  1106.   if (! (methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN
  1107.      || methods == OPTAB_MUST_WIDEN))
  1108.     {
  1109.       /* Caller says, don't even try.  */
  1110.       delete_insns_since (entry_last);
  1111.       return 0;
  1112.     }
  1113.  
  1114.   /* Compute the value of METHODS to pass to recursive calls.
  1115.      Don't allow widening to be tried recursively.  */
  1116.  
  1117.   methods = (methods == OPTAB_LIB_WIDEN ? OPTAB_LIB : OPTAB_DIRECT);
  1118.  
  1119.   /* Look for a wider mode of the same class for which it appears we can do
  1120.      the operation.  */
  1121.  
  1122.   if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
  1123.     {
  1124.       for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  1125.        wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  1126.     {
  1127.       if ((binoptab->handlers[(int) wider_mode].insn_code
  1128.            != CODE_FOR_nothing)
  1129.           || (methods == OPTAB_LIB
  1130.           && binoptab->handlers[(int) wider_mode].libfunc))
  1131.         {
  1132.           rtx xop0 = op0, xop1 = op1;
  1133.           int no_extend = 0;
  1134.  
  1135.           /* For certain integer operations, we need not actually extend
  1136.          the narrow operands, as long as we will truncate
  1137.          the results to the same narrowness.  Don't do this when
  1138.          WIDER_MODE is wider than a word since a paradoxical SUBREG
  1139.          isn't valid for such modes.  */
  1140.  
  1141.           if ((binoptab == ior_optab || binoptab == and_optab
  1142.            || binoptab == xor_optab
  1143.            || binoptab == add_optab || binoptab == sub_optab
  1144.            || binoptab == smul_optab
  1145.            || binoptab == ashl_optab || binoptab == lshl_optab)
  1146.           && class == MODE_INT
  1147.           && GET_MODE_SIZE (wider_mode) <= UNITS_PER_WORD)
  1148.         no_extend = 1;
  1149.  
  1150.           /* If an operand is a constant integer, we might as well
  1151.          convert it since that is more efficient than using a SUBREG,
  1152.          unlike the case for other operands.  Similarly for
  1153.          SUBREGs that were made due to promoted objects.*/
  1154.  
  1155.           if (no_extend && GET_MODE (xop0) != VOIDmode
  1156.         && ! (GET_CODE (xop0) == SUBREG
  1157.               && SUBREG_PROMOTED_VAR_P (xop0)))
  1158.         xop0 = gen_rtx (SUBREG, wider_mode,
  1159.                 force_reg (GET_MODE (xop0), xop0), 0);
  1160.           else
  1161.         xop0 = convert_to_mode (wider_mode, xop0, unsignedp);
  1162.  
  1163.           if (no_extend && GET_MODE (xop1) != VOIDmode
  1164.         && ! (GET_CODE (xop1) == SUBREG
  1165.               && SUBREG_PROMOTED_VAR_P (xop1)))
  1166.         xop1 = gen_rtx (SUBREG, wider_mode,
  1167.                 force_reg (GET_MODE (xop1), xop1), 0);
  1168.           else
  1169.         xop1 = convert_to_mode (wider_mode, xop1, unsignedp);
  1170.  
  1171.           temp = expand_binop (wider_mode, binoptab, xop0, xop1, NULL_RTX,
  1172.                    unsignedp, methods);
  1173.           if (temp)
  1174.         {
  1175.           if (class != MODE_INT)
  1176.             {
  1177.               if (target == 0)
  1178.             target = gen_reg_rtx (mode);
  1179.               convert_move (target, temp, 0);
  1180.               return target;
  1181.             }
  1182.           else
  1183.             return gen_lowpart (mode, temp);
  1184.         }
  1185.           else
  1186.         delete_insns_since (last);
  1187.         }
  1188.     }
  1189.     }
  1190.  
  1191.   delete_insns_since (entry_last);
  1192.   return 0;
  1193. }
  1194.  
  1195. /* Expand a binary operator which has both signed and unsigned forms.
  1196.    UOPTAB is the optab for unsigned operations, and SOPTAB is for
  1197.    signed operations.
  1198.  
  1199.    If we widen unsigned operands, we may use a signed wider operation instead
  1200.    of an unsigned wider operation, since the result would be the same.  */
  1201.  
  1202. rtx
  1203. sign_expand_binop (mode, uoptab, soptab, op0, op1, target, unsignedp, methods)
  1204.     enum machine_mode mode;
  1205.     optab uoptab, soptab;
  1206.     rtx op0, op1, target;
  1207.     int unsignedp;
  1208.     enum optab_methods methods;
  1209. {
  1210.   register rtx temp;
  1211.   optab direct_optab = unsignedp ? uoptab : soptab;
  1212.   struct optab wide_soptab;
  1213.  
  1214.   /* Do it without widening, if possible.  */
  1215.   temp = expand_binop (mode, direct_optab, op0, op1, target,
  1216.                unsignedp, OPTAB_DIRECT);
  1217.   if (temp || methods == OPTAB_DIRECT)
  1218.     return temp;
  1219.  
  1220.   /* Try widening to a signed int.  Make a fake signed optab that
  1221.      hides any signed insn for direct use.  */
  1222.   wide_soptab = *soptab;
  1223.   wide_soptab.handlers[(int) mode].insn_code = CODE_FOR_nothing;
  1224.   wide_soptab.handlers[(int) mode].libfunc = 0;
  1225.  
  1226.   temp = expand_binop (mode, &wide_soptab, op0, op1, target,
  1227.                unsignedp, OPTAB_WIDEN);
  1228.  
  1229.   /* For unsigned operands, try widening to an unsigned int.  */
  1230.   if (temp == 0 && unsignedp)
  1231.     temp = expand_binop (mode, uoptab, op0, op1, target,
  1232.              unsignedp, OPTAB_WIDEN);
  1233.   if (temp || methods == OPTAB_WIDEN)
  1234.     return temp;
  1235.  
  1236.   /* Use the right width lib call if that exists.  */
  1237.   temp = expand_binop (mode, direct_optab, op0, op1, target, unsignedp, OPTAB_LIB);
  1238.   if (temp || methods == OPTAB_LIB)
  1239.     return temp;
  1240.  
  1241.   /* Must widen and use a lib call, use either signed or unsigned.  */
  1242.   temp = expand_binop (mode, &wide_soptab, op0, op1, target,
  1243.                unsignedp, methods);
  1244.   if (temp != 0)
  1245.     return temp;
  1246.   if (unsignedp)
  1247.     return expand_binop (mode, uoptab, op0, op1, target,
  1248.              unsignedp, methods);
  1249.   return 0;
  1250. }
  1251.  
  1252. /* Generate code to perform an operation specified by BINOPTAB
  1253.    on operands OP0 and OP1, with two results to TARG1 and TARG2.
  1254.    We assume that the order of the operands for the instruction
  1255.    is TARG0, OP0, OP1, TARG1, which would fit a pattern like
  1256.    [(set TARG0 (operate OP0 OP1)) (set TARG1 (operate ...))].
  1257.  
  1258.    Either TARG0 or TARG1 may be zero, but what that means is that
  1259.    that result is not actually wanted.  We will generate it into
  1260.    a dummy pseudo-reg and discard it.  They may not both be zero.
  1261.  
  1262.    Returns 1 if this operation can be performed; 0 if not.  */
  1263.  
  1264. int
  1265. expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp)
  1266.      optab binoptab;
  1267.      rtx op0, op1;
  1268.      rtx targ0, targ1;
  1269.      int unsignedp;
  1270. {
  1271.   enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
  1272.   enum mode_class class;
  1273.   enum machine_mode wider_mode;
  1274.   rtx entry_last = get_last_insn ();
  1275.   rtx last;
  1276.  
  1277.   class = GET_MODE_CLASS (mode);
  1278.  
  1279.   op0 = protect_from_queue (op0, 0);
  1280.   op1 = protect_from_queue (op1, 0);
  1281.  
  1282.   if (flag_force_mem)
  1283.     {
  1284.       op0 = force_not_mem (op0);
  1285.       op1 = force_not_mem (op1);
  1286.     }
  1287.  
  1288.   /* If we are inside an appropriately-short loop and one operand is an
  1289.      expensive constant, force it into a register.  */
  1290.   if (CONSTANT_P (op0) && preserve_subexpressions_p ()
  1291.       && rtx_cost (op0, binoptab->code) > 2)
  1292.     op0 = force_reg (mode, op0);
  1293.  
  1294.   if (CONSTANT_P (op1) && preserve_subexpressions_p ()
  1295.       && rtx_cost (op1, binoptab->code) > 2)
  1296.     op1 = force_reg (mode, op1);
  1297.  
  1298.   if (targ0)
  1299.     targ0 = protect_from_queue (targ0, 1);
  1300.   else
  1301.     targ0 = gen_reg_rtx (mode);
  1302.   if (targ1)
  1303.     targ1 = protect_from_queue (targ1, 1);
  1304.   else
  1305.     targ1 = gen_reg_rtx (mode);
  1306.  
  1307.   /* Record where to go back to if we fail.  */
  1308.   last = get_last_insn ();
  1309.  
  1310.   if (binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  1311.     {
  1312.       int icode = (int) binoptab->handlers[(int) mode].insn_code;
  1313.       enum machine_mode mode0 = insn_operand_mode[icode][1];
  1314.       enum machine_mode mode1 = insn_operand_mode[icode][2];
  1315.       rtx pat;
  1316.       rtx xop0 = op0, xop1 = op1;
  1317.  
  1318.       /* In case this insn wants input operands in modes different from the
  1319.      result, convert the operands.  */
  1320.       if (GET_MODE (op0) != VOIDmode && GET_MODE (op0) != mode0)
  1321.     xop0 = convert_to_mode (mode0, xop0, unsignedp);
  1322.  
  1323.       if (GET_MODE (op1) != VOIDmode && GET_MODE (op1) != mode1)
  1324.     xop1 = convert_to_mode (mode1, xop1, unsignedp);
  1325.  
  1326.       /* Now, if insn doesn't accept these operands, put them into pseudos.  */
  1327.       if (! (*insn_operand_predicate[icode][1]) (xop0, mode0))
  1328.     xop0 = copy_to_mode_reg (mode0, xop0);
  1329.  
  1330.       if (! (*insn_operand_predicate[icode][2]) (xop1, mode1))
  1331.     xop1 = copy_to_mode_reg (mode1, xop1);
  1332.  
  1333.       /* We could handle this, but we should always be called with a pseudo
  1334.      for our targets and all insns should take them as outputs.  */
  1335.       if (! (*insn_operand_predicate[icode][0]) (targ0, mode)
  1336.       || ! (*insn_operand_predicate[icode][3]) (targ1, mode))
  1337.     abort ();
  1338.     
  1339.       pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1);
  1340.       if (pat)
  1341.     {
  1342.       emit_insn (pat);
  1343.       return 1;
  1344.     }
  1345.       else
  1346.     delete_insns_since (last);
  1347.     }
  1348.  
  1349.   /* It can't be done in this mode.  Can we do it in a wider mode?  */
  1350.  
  1351.   if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
  1352.     {
  1353.       for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  1354.        wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  1355.     {
  1356.       if (binoptab->handlers[(int) wider_mode].insn_code
  1357.           != CODE_FOR_nothing)
  1358.         {
  1359.           register rtx t0 = gen_reg_rtx (wider_mode);
  1360.           register rtx t1 = gen_reg_rtx (wider_mode);
  1361.  
  1362.           if (expand_twoval_binop (binoptab,
  1363.                        convert_to_mode (wider_mode, op0,
  1364.                             unsignedp),
  1365.                        convert_to_mode (wider_mode, op1,
  1366.                             unsignedp),
  1367.                        t0, t1, unsignedp))
  1368.         {
  1369.           convert_move (targ0, t0, unsignedp);
  1370.           convert_move (targ1, t1, unsignedp);
  1371.           return 1;
  1372.         }
  1373.           else
  1374.         delete_insns_since (last);
  1375.         }
  1376.     }
  1377.     }
  1378.  
  1379.   delete_insns_since (entry_last);
  1380.   return 0;
  1381. }
  1382.  
  1383. /* Generate code to perform an operation specified by UNOPTAB
  1384.    on operand OP0, with result having machine-mode MODE.
  1385.  
  1386.    UNSIGNEDP is for the case where we have to widen the operands
  1387.    to perform the operation.  It says to use zero-extension.
  1388.  
  1389.    If TARGET is nonzero, the value
  1390.    is generated there, if it is convenient to do so.
  1391.    In all cases an rtx is returned for the locus of the value;
  1392.    this may or may not be TARGET.  */
  1393.  
  1394. rtx
  1395. expand_unop (mode, unoptab, op0, target, unsignedp)
  1396.      enum machine_mode mode;
  1397.      optab unoptab;
  1398.      rtx op0;
  1399.      rtx target;
  1400.      int unsignedp;
  1401. {
  1402.   enum mode_class class;
  1403.   enum machine_mode wider_mode;
  1404.   register rtx temp;
  1405.   rtx last = get_last_insn ();
  1406.   rtx pat;
  1407.  
  1408.   class = GET_MODE_CLASS (mode);
  1409.  
  1410.   op0 = protect_from_queue (op0, 0);
  1411.  
  1412.   if (flag_force_mem)
  1413.     {
  1414.       op0 = force_not_mem (op0);
  1415.     }
  1416.  
  1417.   if (target)
  1418.     target = protect_from_queue (target, 1);
  1419.  
  1420.   if (unoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  1421.     {
  1422.       int icode = (int) unoptab->handlers[(int) mode].insn_code;
  1423.       enum machine_mode mode0 = insn_operand_mode[icode][1];
  1424.       rtx xop0 = op0;
  1425.  
  1426.       if (target)
  1427.     temp = target;
  1428.       else
  1429.     temp = gen_reg_rtx (mode);
  1430.  
  1431.       if (GET_MODE (xop0) != VOIDmode
  1432.       && GET_MODE (xop0) != mode0)
  1433.     xop0 = convert_to_mode (mode0, xop0, unsignedp);
  1434.  
  1435.       /* Now, if insn doesn't accept our operand, put it into a pseudo.  */
  1436.  
  1437.       if (! (*insn_operand_predicate[icode][1]) (xop0, mode0))
  1438.     xop0 = copy_to_mode_reg (mode0, xop0);
  1439.  
  1440.       if (! (*insn_operand_predicate[icode][0]) (temp, mode))
  1441.     temp = gen_reg_rtx (mode);
  1442.  
  1443.       pat = GEN_FCN (icode) (temp, xop0);
  1444.       if (pat)
  1445.     {
  1446.       if (GET_CODE (pat) == SEQUENCE
  1447.           && ! add_equal_note (pat, temp, unoptab->code, xop0, NULL_RTX))
  1448.         {
  1449.           delete_insns_since (last);
  1450.           return expand_unop (mode, unoptab, op0, NULL_RTX, unsignedp);
  1451.         }
  1452.  
  1453.       emit_insn (pat);
  1454.       
  1455.       return temp;
  1456.     }
  1457.       else
  1458.     delete_insns_since (last);
  1459.     }
  1460.  
  1461.   /* It can't be done in this mode.  Can we open-code it in a wider mode?  */
  1462.  
  1463.   if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
  1464.     for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  1465.      wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  1466.       {
  1467.     if (unoptab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing)
  1468.       {
  1469.         rtx xop0 = op0;
  1470.  
  1471.         /* For certain operations, we need not actually extend
  1472.            the narrow operand, as long as we will truncate the
  1473.            results to the same narrowness.  But it is faster to
  1474.            convert a SUBREG due to mode promotion.  */
  1475.  
  1476.         if ((unoptab == neg_optab || unoptab == one_cmpl_optab)
  1477.         && GET_MODE_SIZE (wider_mode) <= UNITS_PER_WORD
  1478.         && class == MODE_INT
  1479.         && ! (GET_CODE (xop0) == SUBREG
  1480.               && SUBREG_PROMOTED_VAR_P (xop0)))
  1481.           xop0 = gen_rtx (SUBREG, wider_mode, force_reg (mode, xop0), 0);
  1482.         else
  1483.           xop0 = convert_to_mode (wider_mode, xop0, unsignedp);
  1484.           
  1485.         temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
  1486.                 unsignedp);
  1487.  
  1488.         if (temp)
  1489.           {
  1490.         if (class != MODE_INT)
  1491.           {
  1492.             if (target == 0)
  1493.               target = gen_reg_rtx (mode);
  1494.             convert_move (target, temp, 0);
  1495.             return target;
  1496.           }
  1497.         else
  1498.           return gen_lowpart (mode, temp);
  1499.           }
  1500.         else
  1501.           delete_insns_since (last);
  1502.       }
  1503.       }
  1504.  
  1505.   /* These can be done a word at a time.  */
  1506.   if (unoptab == one_cmpl_optab
  1507.       && class == MODE_INT
  1508.       && GET_MODE_SIZE (mode) > UNITS_PER_WORD
  1509.       && unoptab->handlers[(int) word_mode].insn_code != CODE_FOR_nothing)
  1510.     {
  1511.       int i;
  1512.       rtx insns;
  1513.  
  1514.       if (target == 0 || target == op0)
  1515.     target = gen_reg_rtx (mode);
  1516.  
  1517.       start_sequence ();
  1518.  
  1519.       /* Do the actual arithmetic.  */
  1520.       for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
  1521.     {
  1522.       rtx target_piece = operand_subword (target, i, 1, mode);
  1523.       rtx x = expand_unop (word_mode, unoptab,
  1524.                    operand_subword_force (op0, i, mode),
  1525.                    target_piece, unsignedp);
  1526.       if (target_piece != x)
  1527.         emit_move_insn (target_piece, x);
  1528.     }
  1529.  
  1530.       insns = get_insns ();
  1531.       end_sequence ();
  1532.  
  1533.       emit_no_conflict_block (insns, target, op0, NULL_RTX,
  1534.                   gen_rtx (unoptab->code, mode, op0));
  1535.       return target;
  1536.     }
  1537.  
  1538.   /* Open-code the complex negation operation.  */
  1539.   else if (unoptab == neg_optab
  1540.        && (class == MODE_COMPLEX_FLOAT || class == MODE_COMPLEX_INT))
  1541.     {
  1542.       rtx target_piece;
  1543.       rtx x;
  1544.       rtx seq;
  1545.  
  1546.       /* Find the correct mode for the real and imaginary parts */
  1547.       enum machine_mode submode
  1548.     = mode_for_size (GET_MODE_UNIT_SIZE (mode) * BITS_PER_UNIT,
  1549.              class == MODE_COMPLEX_INT ? MODE_INT : MODE_FLOAT,
  1550.              0);
  1551.  
  1552.       if (submode == BLKmode)
  1553.     abort ();
  1554.  
  1555.       if (target == 0)
  1556.     target = gen_reg_rtx (mode);
  1557.       
  1558.       start_sequence ();
  1559.  
  1560.       target_piece = gen_imagpart (submode, target);
  1561.       x = expand_unop (submode, unoptab,
  1562.                gen_imagpart (submode, op0),
  1563.                target_piece, unsignedp);
  1564.       if (target_piece != x)
  1565.     emit_move_insn (target_piece, x);
  1566.  
  1567.       target_piece = gen_realpart (submode, target);
  1568.       x = expand_unop (submode, unoptab,
  1569.                gen_realpart (submode, op0),
  1570.                target_piece, unsignedp);
  1571.       if (target_piece != x)
  1572.     emit_move_insn (target_piece, x);
  1573.  
  1574.       seq = get_insns ();
  1575.       end_sequence ();
  1576.  
  1577.       emit_no_conflict_block (seq, target, op0, 0,
  1578.                   gen_rtx (unoptab->code, mode, op0));
  1579.       return target;
  1580.     }
  1581.  
  1582.   /* Now try a library call in this mode.  */
  1583.   if (unoptab->handlers[(int) mode].libfunc)
  1584.     {
  1585.       rtx insns;
  1586.       rtx funexp = unoptab->handlers[(int) mode].libfunc;
  1587.  
  1588.       start_sequence ();
  1589.  
  1590.       /* Pass 1 for NO_QUEUE so we don't lose any increments
  1591.      if the libcall is cse'd or moved.  */
  1592.       emit_library_call (unoptab->handlers[(int) mode].libfunc,
  1593.              1, mode, 1, op0, mode);
  1594.       insns = get_insns ();
  1595.       end_sequence ();
  1596.  
  1597.       target = gen_reg_rtx (mode);
  1598.       emit_libcall_block (insns, target, hard_libcall_value (mode),
  1599.               gen_rtx (unoptab->code, mode, op0));
  1600.  
  1601.       return target;
  1602.     }
  1603.  
  1604.   /* It can't be done in this mode.  Can we do it in a wider mode?  */
  1605.  
  1606.   if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
  1607.     {
  1608.       for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  1609.        wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  1610.     {
  1611.       if ((unoptab->handlers[(int) wider_mode].insn_code
  1612.            != CODE_FOR_nothing)
  1613.           || unoptab->handlers[(int) wider_mode].libfunc)
  1614.         {
  1615.           rtx xop0 = op0;
  1616.  
  1617.           /* For certain operations, we need not actually extend
  1618.          the narrow operand, as long as we will truncate the
  1619.          results to the same narrowness.  */
  1620.  
  1621.           if ((unoptab == neg_optab || unoptab == one_cmpl_optab)
  1622.           && GET_MODE_SIZE (wider_mode) <= UNITS_PER_WORD
  1623.           && class == MODE_INT
  1624.           && ! (GET_CODE (xop0) == SUBREG
  1625.             && SUBREG_PROMOTED_VAR_P (xop0)))
  1626.         xop0 = gen_rtx (SUBREG, wider_mode, force_reg (mode, xop0), 0);
  1627.           else
  1628.         xop0 = convert_to_mode (wider_mode, xop0, unsignedp);
  1629.           
  1630.           temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
  1631.                   unsignedp);
  1632.  
  1633.           if (temp)
  1634.         {
  1635.           if (class != MODE_INT)
  1636.             {
  1637.               if (target == 0)
  1638.             target = gen_reg_rtx (mode);
  1639.               convert_move (target, temp, 0);
  1640.               return target;
  1641.             }
  1642.           else
  1643.             return gen_lowpart (mode, temp);
  1644.         }
  1645.           else
  1646.         delete_insns_since (last);
  1647.         }
  1648.     }
  1649.     }
  1650.  
  1651.   return 0;
  1652. }
  1653.  
  1654. /* Emit code to compute the absolute value of OP0, with result to
  1655.    TARGET if convenient.  (TARGET may be 0.)  The return value says
  1656.    where the result actually is to be found.
  1657.  
  1658.    MODE is the mode of the operand; the mode of the result is
  1659.    different but can be deduced from MODE.
  1660.  
  1661.    UNSIGNEDP is relevant for complex integer modes.  */
  1662.  
  1663. rtx
  1664. expand_complex_abs (mode, op0, target, unsignedp)
  1665.      enum machine_mode mode;
  1666.      rtx op0;
  1667.      rtx target;
  1668.      int unsignedp;
  1669. {
  1670.   enum mode_class class = GET_MODE_CLASS (mode);
  1671.   enum machine_mode wider_mode;
  1672.   register rtx temp;
  1673.   rtx entry_last = get_last_insn ();
  1674.   rtx last;
  1675.   rtx pat;
  1676.  
  1677.   /* Find the correct mode for the real and imaginary parts.  */
  1678.   enum machine_mode submode
  1679.     = mode_for_size (GET_MODE_UNIT_SIZE (mode) * BITS_PER_UNIT,
  1680.              class == MODE_COMPLEX_INT ? MODE_INT : MODE_FLOAT,
  1681.              0);
  1682.  
  1683.   if (submode == BLKmode)
  1684.     abort ();
  1685.  
  1686.   op0 = protect_from_queue (op0, 0);
  1687.  
  1688.   if (flag_force_mem)
  1689.     {
  1690.       op0 = force_not_mem (op0);
  1691.     }
  1692.  
  1693.   last = get_last_insn ();
  1694.  
  1695.   if (target)
  1696.     target = protect_from_queue (target, 1);
  1697.  
  1698.   if (abs_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  1699.     {
  1700.       int icode = (int) abs_optab->handlers[(int) mode].insn_code;
  1701.       enum machine_mode mode0 = insn_operand_mode[icode][1];
  1702.       rtx xop0 = op0;
  1703.  
  1704.       if (target)
  1705.     temp = target;
  1706.       else
  1707.     temp = gen_reg_rtx (submode);
  1708.  
  1709.       if (GET_MODE (xop0) != VOIDmode
  1710.       && GET_MODE (xop0) != mode0)
  1711.     xop0 = convert_to_mode (mode0, xop0, unsignedp);
  1712.  
  1713.       /* Now, if insn doesn't accept our operand, put it into a pseudo.  */
  1714.  
  1715.       if (! (*insn_operand_predicate[icode][1]) (xop0, mode0))
  1716.     xop0 = copy_to_mode_reg (mode0, xop0);
  1717.  
  1718.       if (! (*insn_operand_predicate[icode][0]) (temp, submode))
  1719.     temp = gen_reg_rtx (submode);
  1720.  
  1721.       pat = GEN_FCN (icode) (temp, xop0);
  1722.       if (pat)
  1723.     {
  1724.       if (GET_CODE (pat) == SEQUENCE
  1725.           && ! add_equal_note (pat, temp, abs_optab->code, xop0, NULL_RTX))
  1726.         {
  1727.           delete_insns_since (last);
  1728.           return expand_unop (mode, abs_optab, op0, NULL_RTX, unsignedp);
  1729.         }
  1730.  
  1731.       emit_insn (pat);
  1732.       
  1733.       return temp;
  1734.     }
  1735.       else
  1736.     delete_insns_since (last);
  1737.     }
  1738.  
  1739.   /* It can't be done in this mode.  Can we open-code it in a wider mode?  */
  1740.  
  1741.   for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  1742.        wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  1743.     {
  1744.       if (abs_optab->handlers[(int) wider_mode].insn_code != CODE_FOR_nothing)
  1745.     {
  1746.       rtx xop0 = op0;
  1747.  
  1748.       xop0 = convert_to_mode (wider_mode, xop0, unsignedp);
  1749.       temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp);
  1750.  
  1751.       if (temp)
  1752.         {
  1753.           if (class != MODE_COMPLEX_INT)
  1754.         {
  1755.           if (target == 0)
  1756.             target = gen_reg_rtx (submode);
  1757.           convert_move (target, temp, 0);
  1758.           return target;
  1759.         }
  1760.           else
  1761.         return gen_lowpart (submode, temp);
  1762.         }
  1763.       else
  1764.         delete_insns_since (last);
  1765.     }
  1766.     }
  1767.  
  1768.   /* Open-code the complex absolute-value operation
  1769.      if we can open-code sqrt.  Otherwise it's not worth while.  */
  1770.   if (sqrt_optab->handlers[(int) submode].insn_code != CODE_FOR_nothing)
  1771.     {
  1772.       rtx real, imag, total;
  1773.  
  1774.       real = gen_realpart (submode, op0);
  1775.       imag = gen_imagpart (submode, op0);
  1776.       /* Square both parts.  */
  1777.       real = expand_mult (mode, real, real, NULL_RTX, 0);
  1778.       imag = expand_mult (mode, imag, imag, NULL_RTX, 0);
  1779.       /* Sum the parts.  */
  1780.       total = expand_binop (submode, add_optab, real, imag, 0,
  1781.                 0, OPTAB_LIB_WIDEN);
  1782.       /* Get sqrt in TARGET.  Set TARGET to where the result is.  */
  1783.       target = expand_unop (submode, sqrt_optab, total, target, 0);
  1784.       if (target == 0)
  1785.     delete_insns_since (last);
  1786.       else
  1787.     return target;
  1788.     }
  1789.  
  1790.   /* Now try a library call in this mode.  */
  1791.   if (abs_optab->handlers[(int) mode].libfunc)
  1792.     {
  1793.       rtx insns;
  1794.       rtx funexp = abs_optab->handlers[(int) mode].libfunc;
  1795.  
  1796.       start_sequence ();
  1797.  
  1798.       /* Pass 1 for NO_QUEUE so we don't lose any increments
  1799.      if the libcall is cse'd or moved.  */
  1800.       emit_library_call (abs_optab->handlers[(int) mode].libfunc,
  1801.              1, mode, 1, op0, mode);
  1802.       insns = get_insns ();
  1803.       end_sequence ();
  1804.  
  1805.       target = gen_reg_rtx (submode);
  1806.       emit_libcall_block (insns, target, hard_libcall_value (submode),
  1807.               gen_rtx (abs_optab->code, mode, op0));
  1808.  
  1809.       return target;
  1810.     }
  1811.  
  1812.   /* It can't be done in this mode.  Can we do it in a wider mode?  */
  1813.  
  1814.   for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  1815.        wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  1816.     {
  1817.       if ((abs_optab->handlers[(int) wider_mode].insn_code
  1818.        != CODE_FOR_nothing)
  1819.       || abs_optab->handlers[(int) wider_mode].libfunc)
  1820.     {
  1821.       rtx xop0 = op0;
  1822.  
  1823.       xop0 = convert_to_mode (wider_mode, xop0, unsignedp);
  1824.  
  1825.       temp = expand_complex_abs (wider_mode, xop0, NULL_RTX, unsignedp);
  1826.  
  1827.       if (temp)
  1828.         {
  1829.           if (class != MODE_COMPLEX_INT)
  1830.         {
  1831.           if (target == 0)
  1832.             target = gen_reg_rtx (submode);
  1833.           convert_move (target, temp, 0);
  1834.           return target;
  1835.         }
  1836.           else
  1837.         return gen_lowpart (submode, temp);
  1838.         }
  1839.       else
  1840.         delete_insns_since (last);
  1841.     }
  1842.     }
  1843.  
  1844.   delete_insns_since (entry_last);
  1845.   return 0;
  1846. }
  1847.  
  1848. /* Generate an instruction whose insn-code is INSN_CODE,
  1849.    with two operands: an output TARGET and an input OP0.
  1850.    TARGET *must* be nonzero, and the output is always stored there.
  1851.    CODE is an rtx code such that (CODE OP0) is an rtx that describes
  1852.    the value that is stored into TARGET.  */
  1853.  
  1854. void
  1855. emit_unop_insn (icode, target, op0, code)
  1856.      int icode;
  1857.      rtx target;
  1858.      rtx op0;
  1859.      enum rtx_code code;
  1860. {
  1861.   register rtx temp;
  1862.   enum machine_mode mode0 = insn_operand_mode[icode][1];
  1863.   rtx pat;
  1864.  
  1865.   temp = target = protect_from_queue (target, 1);
  1866.  
  1867.   op0 = protect_from_queue (op0, 0);
  1868.  
  1869.   if (flag_force_mem)
  1870.     op0 = force_not_mem (op0);
  1871.  
  1872.   /* Now, if insn does not accept our operands, put them into pseudos.  */
  1873.  
  1874.   if (! (*insn_operand_predicate[icode][1]) (op0, mode0))
  1875.     op0 = copy_to_mode_reg (mode0, op0);
  1876.  
  1877.   if (! (*insn_operand_predicate[icode][0]) (temp, GET_MODE (temp))
  1878.       || (flag_force_mem && GET_CODE (temp) == MEM))
  1879.     temp = gen_reg_rtx (GET_MODE (temp));
  1880.  
  1881.   pat = GEN_FCN (icode) (temp, op0);
  1882.  
  1883.   if (GET_CODE (pat) == SEQUENCE && code != UNKNOWN)
  1884.     add_equal_note (pat, temp, code, op0, NULL_RTX);
  1885.   
  1886.   emit_insn (pat);
  1887.  
  1888.   if (temp != target)
  1889.     emit_move_insn (target, temp);
  1890. }
  1891.  
  1892. /* Emit code to perform a series of operations on a multi-word quantity, one
  1893.    word at a time.
  1894.  
  1895.    Such a block is preceded by a CLOBBER of the output, consists of multiple
  1896.    insns, each setting one word of the output, and followed by a SET copying
  1897.    the output to itself.
  1898.  
  1899.    Each of the insns setting words of the output receives a REG_NO_CONFLICT
  1900.    note indicating that it doesn't conflict with the (also multi-word)
  1901.    inputs.  The entire block is surrounded by REG_LIBCALL and REG_RETVAL
  1902.    notes.
  1903.  
  1904.    INSNS is a block of code generated to perform the operation, not including
  1905.    the CLOBBER and final copy.  All insns that compute intermediate values
  1906.    are first emitted, followed by the block as described above.  Only
  1907.    INSNs are allowed in the block; no library calls or jumps may be
  1908.    present.
  1909.  
  1910.    TARGET, OP0, and OP1 are the output and inputs of the operations,
  1911.    respectively.  OP1 may be zero for a unary operation.
  1912.  
  1913.    EQUIV, if non-zero, is an expression to be placed into a REG_EQUAL note
  1914.    on the last insn.
  1915.  
  1916.    If TARGET is not a register, INSNS is simply emitted with no special
  1917.    processing.
  1918.  
  1919.    The final insn emitted is returned.  */
  1920.  
  1921. rtx
  1922. emit_no_conflict_block (insns, target, op0, op1, equiv)
  1923.      rtx insns;
  1924.      rtx target;
  1925.      rtx op0, op1;
  1926.      rtx equiv;
  1927. {
  1928.   rtx prev, next, first, last, insn;
  1929.  
  1930.   if (GET_CODE (target) != REG || reload_in_progress)
  1931.     return emit_insns (insns);
  1932.  
  1933.   /* First emit all insns that do not store into words of the output and remove
  1934.      these from the list.  */
  1935.   for (insn = insns; insn; insn = next)
  1936.     {
  1937.       rtx set = 0;
  1938.       int i;
  1939.  
  1940.       next = NEXT_INSN (insn);
  1941.  
  1942.       if (GET_CODE (insn) != INSN)
  1943.     abort ();
  1944.  
  1945.       if (GET_CODE (PATTERN (insn)) == SET)
  1946.     set = PATTERN (insn);
  1947.       else if (GET_CODE (PATTERN (insn)) == PARALLEL)
  1948.     {
  1949.       for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
  1950.         if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET)
  1951.           {
  1952.         set = XVECEXP (PATTERN (insn), 0, i);
  1953.         break;
  1954.           }
  1955.     }
  1956.  
  1957.       if (set == 0)
  1958.     abort ();
  1959.  
  1960.       if (! reg_overlap_mentioned_p (target, SET_DEST (set)))
  1961.     {
  1962.       if (PREV_INSN (insn))
  1963.         NEXT_INSN (PREV_INSN (insn)) = next;
  1964.       else
  1965.         insns = next;
  1966.  
  1967.       if (next)
  1968.         PREV_INSN (next) = PREV_INSN (insn);
  1969.  
  1970.       add_insn (insn);
  1971.     }
  1972.     }
  1973.  
  1974.   prev = get_last_insn ();
  1975.  
  1976.   /* Now write the CLOBBER of the output, followed by the setting of each
  1977.      of the words, followed by the final copy.  */
  1978.   if (target != op0 && target != op1)
  1979.     emit_insn (gen_rtx (CLOBBER, VOIDmode, target));
  1980.  
  1981.   for (insn = insns; insn; insn = next)
  1982.     {
  1983.       next = NEXT_INSN (insn);
  1984.       add_insn (insn);
  1985.  
  1986.       if (op1 && GET_CODE (op1) == REG)
  1987.     REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_NO_CONFLICT, op1,
  1988.                     REG_NOTES (insn));
  1989.  
  1990.       if (op0 && GET_CODE (op0) == REG)
  1991.     REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_NO_CONFLICT, op0,
  1992.                     REG_NOTES (insn));
  1993.     }
  1994.  
  1995.   last = emit_move_insn (target, target);
  1996.   if (equiv)
  1997.     REG_NOTES (last) = gen_rtx (EXPR_LIST, REG_EQUAL, equiv, REG_NOTES (last));
  1998.  
  1999.   if (prev == 0)
  2000.     first = get_insns ();
  2001.   else
  2002.     first = NEXT_INSN (prev);
  2003.  
  2004.   /* Encapsulate the block so it gets manipulated as a unit.  */
  2005.   REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
  2006.                    REG_NOTES (first));
  2007.   REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
  2008.  
  2009.   return last;
  2010. }
  2011.  
  2012. /* Emit code to make a call to a constant function or a library call.
  2013.  
  2014.    INSNS is a list containing all insns emitted in the call.
  2015.    These insns leave the result in RESULT.  Our block is to copy RESULT
  2016.    to TARGET, which is logically equivalent to EQUIV.
  2017.  
  2018.    We first emit any insns that set a pseudo on the assumption that these are
  2019.    loading constants into registers; doing so allows them to be safely cse'ed
  2020.    between blocks.  Then we emit all the other insns in the block, followed by
  2021.    an insn to move RESULT to TARGET.  This last insn will have a REQ_EQUAL
  2022.    note with an operand of EQUIV.
  2023.  
  2024.    Moving assignments to pseudos outside of the block is done to improve
  2025.    the generated code, but is not required to generate correct code,
  2026.    hence being unable to move an assignment is not grounds for not making
  2027.    a libcall block.  There are two reasons why it is safe to leave these
  2028.    insns inside the block: First, we know that these pseudos cannot be
  2029.    used in generated RTL outside the block since they are created for
  2030.    temporary purposes within the block.  Second, CSE will not record the
  2031.    values of anything set inside a libcall block, so we know they must
  2032.    be dead at the end of the block.
  2033.  
  2034.    Except for the first group of insns (the ones setting pseudos), the
  2035.    block is delimited by REG_RETVAL and REG_LIBCALL notes.  */
  2036.  
  2037. void
  2038. emit_libcall_block (insns, target, result, equiv)
  2039.      rtx insns;
  2040.      rtx target;
  2041.      rtx result;
  2042.      rtx equiv;
  2043. {
  2044.   rtx prev, next, first, last, insn;
  2045.  
  2046.   /* First emit all insns that set pseudos.  Remove them from the list as
  2047.      we go.  Avoid insns that set pseudo which were referenced in previous
  2048.      insns.  These can be generated by move_by_pieces, for example,
  2049.      to update an address.  */
  2050.  
  2051.   for (insn = insns; insn; insn = next)
  2052.     {
  2053.       rtx set = single_set (insn);
  2054.  
  2055.       next = NEXT_INSN (insn);
  2056.  
  2057.       if (set != 0 && GET_CODE (SET_DEST (set)) == REG
  2058.       && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER
  2059.       && (insn == insns
  2060.           || (! reg_mentioned_p (SET_DEST (set), PATTERN (insns))
  2061.           && ! reg_used_between_p (SET_DEST (set), insns, insn))))
  2062.     {
  2063.       if (PREV_INSN (insn))
  2064.         NEXT_INSN (PREV_INSN (insn)) = next;
  2065.       else
  2066.         insns = next;
  2067.  
  2068.       if (next)
  2069.         PREV_INSN (next) = PREV_INSN (insn);
  2070.  
  2071.       add_insn (insn);
  2072.     }
  2073.     }
  2074.  
  2075.   prev = get_last_insn ();
  2076.  
  2077.   /* Write the remaining insns followed by the final copy.  */
  2078.  
  2079.   for (insn = insns; insn; insn = next)
  2080.     {
  2081.       next = NEXT_INSN (insn);
  2082.  
  2083.       add_insn (insn);
  2084.     }
  2085.  
  2086.   last = emit_move_insn (target, result);
  2087.   REG_NOTES (last) = gen_rtx (EXPR_LIST, REG_EQUAL, equiv, REG_NOTES (last));
  2088.  
  2089.   if (prev == 0)
  2090.     first = get_insns ();
  2091.   else
  2092.     first = NEXT_INSN (prev);
  2093.  
  2094.   /* Encapsulate the block so it gets manipulated as a unit.  */
  2095.   REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
  2096.                    REG_NOTES (first));
  2097.   REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
  2098. }
  2099.  
  2100. /* Generate code to store zero in X.  */
  2101.  
  2102. void
  2103. emit_clr_insn (x)
  2104.      rtx x;
  2105. {
  2106.   emit_move_insn (x, const0_rtx);
  2107. }
  2108.  
  2109. /* Generate code to store 1 in X
  2110.    assuming it contains zero beforehand.  */
  2111.  
  2112. void
  2113. emit_0_to_1_insn (x)
  2114.      rtx x;
  2115. {
  2116.   emit_move_insn (x, const1_rtx);
  2117. }
  2118.  
  2119. /* Generate code to compare X with Y
  2120.    so that the condition codes are set.
  2121.  
  2122.    MODE is the mode of the inputs (in case they are const_int).
  2123.    UNSIGNEDP nonzero says that X and Y are unsigned;
  2124.    this matters if they need to be widened.
  2125.  
  2126.    If they have mode BLKmode, then SIZE specifies the size of both X and Y,
  2127.    and ALIGN specifies the known shared alignment of X and Y.
  2128.  
  2129.    COMPARISON is the rtl operator to compare with (EQ, NE, GT, etc.).
  2130.    It is ignored for fixed-point and block comparisons;
  2131.    it is used only for floating-point comparisons.  */
  2132.  
  2133. void
  2134. emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
  2135.      rtx x, y;
  2136.      enum rtx_code comparison;
  2137.      rtx size;
  2138.      enum machine_mode mode;
  2139.      int unsignedp;
  2140.      int align;
  2141. {
  2142.   enum mode_class class;
  2143.   enum machine_mode wider_mode;
  2144.  
  2145.   class = GET_MODE_CLASS (mode);
  2146.  
  2147.   /* They could both be VOIDmode if both args are immediate constants,
  2148.      but we should fold that at an earlier stage.
  2149.      With no special code here, this will call abort,
  2150.      reminding the programmer to implement such folding.  */
  2151.  
  2152.   if (mode != BLKmode && flag_force_mem)
  2153.     {
  2154.       x = force_not_mem (x);
  2155.       y = force_not_mem (y);
  2156.     }
  2157.  
  2158.   /* If we are inside an appropriately-short loop and one operand is an
  2159.      expensive constant, force it into a register.  */
  2160.   if (CONSTANT_P (x) && preserve_subexpressions_p () && rtx_cost (x, COMPARE) > 2)
  2161.     x = force_reg (mode, x);
  2162.  
  2163.   if (CONSTANT_P (y) && preserve_subexpressions_p () && rtx_cost (y, COMPARE) > 2)
  2164.     y = force_reg (mode, y);
  2165.  
  2166.   /* Don't let both operands fail to indicate the mode.  */
  2167.   if (GET_MODE (x) == VOIDmode && GET_MODE (y) == VOIDmode)
  2168.     x = force_reg (mode, x);
  2169.  
  2170.   /* Handle all BLKmode compares.  */
  2171.  
  2172.   if (mode == BLKmode)
  2173.     {
  2174.       emit_queue ();
  2175.       x = protect_from_queue (x, 0);
  2176.       y = protect_from_queue (y, 0);
  2177.  
  2178.       if (size == 0)
  2179.     abort ();
  2180. #ifdef HAVE_cmpstrqi
  2181.       if (HAVE_cmpstrqi
  2182.       && GET_CODE (size) == CONST_INT
  2183.       && INTVAL (size) < (1 << GET_MODE_BITSIZE (QImode)))
  2184.     {
  2185.       enum machine_mode result_mode
  2186.         = insn_operand_mode[(int) CODE_FOR_cmpstrqi][0];
  2187.       rtx result = gen_reg_rtx (result_mode);
  2188.       emit_insn (gen_cmpstrqi (result, x, y, size, GEN_INT (align)));
  2189.       emit_cmp_insn (result, const0_rtx, comparison, NULL_RTX,
  2190.              result_mode, 0, 0);
  2191.     }
  2192.       else
  2193. #endif
  2194. #ifdef HAVE_cmpstrhi
  2195.       if (HAVE_cmpstrhi
  2196.       && GET_CODE (size) == CONST_INT
  2197.       && INTVAL (size) < (1 << GET_MODE_BITSIZE (HImode)))
  2198.     {
  2199.       enum machine_mode result_mode
  2200.         = insn_operand_mode[(int) CODE_FOR_cmpstrhi][0];
  2201.       rtx result = gen_reg_rtx (result_mode);
  2202.       emit_insn (gen_cmpstrhi (result, x, y, size, GEN_INT (align)));
  2203.       emit_cmp_insn (result, const0_rtx, comparison, NULL_RTX,
  2204.              result_mode, 0, 0);
  2205.     }
  2206.       else
  2207. #endif
  2208. #ifdef HAVE_cmpstrsi
  2209.       if (HAVE_cmpstrsi)
  2210.     {
  2211.       enum machine_mode result_mode
  2212.         = insn_operand_mode[(int) CODE_FOR_cmpstrsi][0];
  2213.       rtx result = gen_reg_rtx (result_mode);
  2214.       size = protect_from_queue (size, 0);
  2215.       emit_insn (gen_cmpstrsi (result, x, y,
  2216.                    convert_to_mode (SImode, size, 1),
  2217.                    GEN_INT (align)));
  2218.       emit_cmp_insn (result, const0_rtx, comparison, NULL_RTX,
  2219.              result_mode, 0, 0);
  2220.     }
  2221.       else
  2222. #endif
  2223.     {
  2224. #ifdef TARGET_MEM_FUNCTIONS
  2225.       emit_library_call (memcmp_libfunc, 0,
  2226.                  TYPE_MODE (integer_type_node), 3,
  2227.                  XEXP (x, 0), DPmode, XEXP (y, 0), DPmode,
  2228.                  size, DPmode);
  2229. #else
  2230.       emit_library_call (bcmp_libfunc, 0,
  2231.                  TYPE_MODE (integer_type_node), 3,
  2232.                  XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
  2233.                  size, Pmode);
  2234. #endif
  2235.       emit_cmp_insn (hard_libcall_value (TYPE_MODE (integer_type_node)),
  2236.              const0_rtx, comparison, NULL_RTX,
  2237.              TYPE_MODE (integer_type_node), 0, 0);
  2238.     }
  2239.       return;
  2240.     }
  2241.  
  2242.   /* Handle some compares against zero.  */
  2243.  
  2244.   if (y == CONST0_RTX (mode)
  2245.       && tst_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  2246.     {
  2247.       int icode = (int) tst_optab->handlers[(int) mode].insn_code;
  2248.  
  2249.       emit_queue ();
  2250.       x = protect_from_queue (x, 0);
  2251.       y = protect_from_queue (y, 0);
  2252.  
  2253.       /* Now, if insn does accept these operands, put them into pseudos.  */
  2254.       if (! (*insn_operand_predicate[icode][0])
  2255.       (x, insn_operand_mode[icode][0]))
  2256.     x = copy_to_mode_reg (insn_operand_mode[icode][0], x);
  2257.  
  2258.       emit_insn (GEN_FCN (icode) (x));
  2259.       return;
  2260.     }
  2261.  
  2262.   /* Handle compares for which there is a directly suitable insn.  */
  2263.  
  2264.   if (cmp_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  2265.     {
  2266.       int icode = (int) cmp_optab->handlers[(int) mode].insn_code;
  2267.  
  2268.       emit_queue ();
  2269.       x = protect_from_queue (x, 0);
  2270.       y = protect_from_queue (y, 0);
  2271.  
  2272.       /* Now, if insn doesn't accept these operands, put them into pseudos.  */
  2273.       if (! (*insn_operand_predicate[icode][0])
  2274.       (x, insn_operand_mode[icode][0]))
  2275.     x = copy_to_mode_reg (insn_operand_mode[icode][0], x);
  2276.  
  2277.       if (! (*insn_operand_predicate[icode][1])
  2278.       (y, insn_operand_mode[icode][1]))
  2279.     y = copy_to_mode_reg (insn_operand_mode[icode][1], y);
  2280.  
  2281.       emit_insn (GEN_FCN (icode) (x, y));
  2282.       return;
  2283.     }
  2284.  
  2285.   /* Try widening if we can find a direct insn that way.  */
  2286.  
  2287.   if (class == MODE_INT || class == MODE_FLOAT || class == MODE_COMPLEX_FLOAT)
  2288.     {
  2289.       for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  2290.        wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  2291.     {
  2292.       if (cmp_optab->handlers[(int) wider_mode].insn_code
  2293.           != CODE_FOR_nothing)
  2294.         {
  2295.           x = protect_from_queue (x, 0);
  2296.           y = protect_from_queue (y, 0);
  2297.           x = convert_to_mode (wider_mode, x, unsignedp);
  2298.           y = convert_to_mode (wider_mode, y, unsignedp);
  2299.           emit_cmp_insn (x, y, comparison, NULL_RTX,
  2300.                  wider_mode, unsignedp, align);
  2301.           return;
  2302.         }
  2303.     }
  2304.     }
  2305.  
  2306.   /* Handle a lib call just for the mode we are using.  */
  2307.  
  2308.   if (cmp_optab->handlers[(int) mode].libfunc
  2309.       && class != MODE_FLOAT)
  2310.     {
  2311.       rtx libfunc = cmp_optab->handlers[(int) mode].libfunc;
  2312.       /* If we want unsigned, and this mode has a distinct unsigned
  2313.      comparison routine, use that.  */
  2314.       if (unsignedp && ucmp_optab->handlers[(int) mode].libfunc)
  2315.     libfunc = ucmp_optab->handlers[(int) mode].libfunc;
  2316.  
  2317.       emit_library_call (libfunc, 1,
  2318.              SImode, 2, x, mode, y, mode);
  2319.  
  2320.       /* Integer comparison returns a result that must be compared against 1,
  2321.      so that even if we do an unsigned compare afterward,
  2322.      there is still a value that can represent the result "less than".  */
  2323.  
  2324.       emit_cmp_insn (hard_libcall_value (SImode), const1_rtx,
  2325.              comparison, NULL_RTX, SImode, unsignedp, 0);
  2326.       return;
  2327.     }
  2328.  
  2329.   if (class == MODE_FLOAT)
  2330.     emit_float_lib_cmp (x, y, comparison);
  2331.  
  2332.   else
  2333.     abort ();
  2334. }
  2335.  
  2336. /* Nonzero if a compare of mode MODE can be done straightforwardly
  2337.    (without splitting it into pieces).  */
  2338.  
  2339. int
  2340. can_compare_p (mode)
  2341.      enum machine_mode mode;
  2342. {
  2343.   do
  2344.     {
  2345.       if (cmp_optab->handlers[(int)mode].insn_code != CODE_FOR_nothing)
  2346.     return 1;
  2347.       mode = GET_MODE_WIDER_MODE (mode);
  2348.     } while (mode != VOIDmode);
  2349.  
  2350.   return 0;
  2351. }
  2352.  
  2353. /* Emit a library call comparison between floating point X and Y.
  2354.    COMPARISON is the rtl operator to compare with (EQ, NE, GT, etc.).  */
  2355.  
  2356. static void
  2357. emit_float_lib_cmp (x, y, comparison)
  2358.      rtx x, y;
  2359.      enum rtx_code comparison;
  2360. {
  2361.   enum machine_mode mode = GET_MODE (x);
  2362.   rtx libfunc;
  2363.  
  2364.   if (mode == SFmode)
  2365.     switch (comparison)
  2366.       {
  2367.       case EQ:
  2368.     libfunc = eqsf2_libfunc;
  2369.     break;
  2370.  
  2371.       case NE:
  2372.     libfunc = nesf2_libfunc;
  2373.     break;
  2374.  
  2375.       case GT:
  2376.     libfunc = gtsf2_libfunc;
  2377.     break;
  2378.  
  2379.       case GE:
  2380.     libfunc = gesf2_libfunc;
  2381.     break;
  2382.  
  2383.       case LT:
  2384.     libfunc = ltsf2_libfunc;
  2385.     break;
  2386.  
  2387.       case LE:
  2388.     libfunc = lesf2_libfunc;
  2389.     break;
  2390.       }
  2391.   else if (mode == DFmode)
  2392.     switch (comparison)
  2393.       {
  2394.       case EQ:
  2395.     libfunc = eqdf2_libfunc;
  2396.     break;
  2397.  
  2398.       case NE:
  2399.     libfunc = nedf2_libfunc;
  2400.     break;
  2401.  
  2402.       case GT:
  2403.     libfunc = gtdf2_libfunc;
  2404.     break;
  2405.  
  2406.       case GE:
  2407.     libfunc = gedf2_libfunc;
  2408.     break;
  2409.  
  2410.       case LT:
  2411.     libfunc = ltdf2_libfunc;
  2412.     break;
  2413.  
  2414.       case LE:
  2415.     libfunc = ledf2_libfunc;
  2416.     break;
  2417.       }
  2418.   else if (mode == XFmode)
  2419.     switch (comparison)
  2420.       {
  2421.       case EQ:
  2422.     libfunc = eqxf2_libfunc;
  2423.     break;
  2424.  
  2425.       case NE:
  2426.     libfunc = nexf2_libfunc;
  2427.     break;
  2428.  
  2429.       case GT:
  2430.     libfunc = gtxf2_libfunc;
  2431.     break;
  2432.  
  2433.       case GE:
  2434.     libfunc = gexf2_libfunc;
  2435.     break;
  2436.  
  2437.       case LT:
  2438.     libfunc = ltxf2_libfunc;
  2439.     break;
  2440.  
  2441.       case LE:
  2442.     libfunc = lexf2_libfunc;
  2443.     break;
  2444.       }
  2445.   else if (mode == TFmode)
  2446.     switch (comparison)
  2447.       {
  2448.       case EQ:
  2449.     libfunc = eqtf2_libfunc;
  2450.     break;
  2451.  
  2452.       case NE:
  2453.     libfunc = netf2_libfunc;
  2454.     break;
  2455.  
  2456.       case GT:
  2457.     libfunc = gttf2_libfunc;
  2458.     break;
  2459.  
  2460.       case GE:
  2461.     libfunc = getf2_libfunc;
  2462.     break;
  2463.  
  2464.       case LT:
  2465.     libfunc = lttf2_libfunc;
  2466.     break;
  2467.  
  2468.       case LE:
  2469.     libfunc = letf2_libfunc;
  2470.     break;
  2471.       }
  2472.   else
  2473.     {
  2474.       enum machine_mode wider_mode;
  2475.  
  2476.       for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
  2477.        wider_mode = GET_MODE_WIDER_MODE (wider_mode))
  2478.     {
  2479.       if ((cmp_optab->handlers[(int) wider_mode].insn_code
  2480.            != CODE_FOR_nothing)
  2481.           || (cmp_optab->handlers[(int) wider_mode].libfunc != 0))
  2482.         {
  2483.           x = protect_from_queue (x, 0);
  2484.           y = protect_from_queue (y, 0);
  2485.           x = convert_to_mode (wider_mode, x, 0);
  2486.           y = convert_to_mode (wider_mode, y, 0);
  2487.           emit_float_lib_cmp (x, y, comparison);
  2488.           return;
  2489.         }
  2490.     }
  2491.       abort ();
  2492.     }
  2493.  
  2494.   emit_library_call (libfunc, 1,
  2495.              SImode, 2, x, mode, y, mode);
  2496.  
  2497.   emit_cmp_insn (hard_libcall_value (SImode), const0_rtx, comparison,
  2498.          NULL_RTX, SImode, 0, 0);
  2499. }
  2500.  
  2501. /* Generate code to indirectly jump to a location given in the rtx LOC.  */
  2502.  
  2503. void
  2504. emit_indirect_jump (loc)
  2505.      rtx loc;
  2506. {
  2507.   if (! ((*insn_operand_predicate[(int)CODE_FOR_indirect_jump][0])
  2508.      (loc, VOIDmode)))
  2509.     loc = copy_to_mode_reg (insn_operand_mode[(int)CODE_FOR_indirect_jump][0],
  2510.                 loc);
  2511.  
  2512.   emit_jump_insn (gen_indirect_jump (loc));
  2513.   emit_barrier ();
  2514. }
  2515.  
  2516. /* These three functions generate an insn body and return it
  2517.    rather than emitting the insn.
  2518.  
  2519.    They do not protect from queued increments,
  2520.    because they may be used 1) in protect_from_queue itself
  2521.    and 2) in other passes where there is no queue.  */
  2522.  
  2523. /* Generate and return an insn body to add Y to X.  */
  2524.  
  2525. rtx
  2526. gen_add2_insn (x, y)
  2527.      rtx x, y;
  2528. {
  2529.   int icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code; 
  2530.  
  2531.   if (! (*insn_operand_predicate[icode][0]) (x, insn_operand_mode[icode][0])
  2532.       || ! (*insn_operand_predicate[icode][1]) (x, insn_operand_mode[icode][1])
  2533.       || ! (*insn_operand_predicate[icode][2]) (y, insn_operand_mode[icode][2]))
  2534.     abort ();
  2535.  
  2536.   return (GEN_FCN (icode) (x, x, y));
  2537. }
  2538.  
  2539. int
  2540. have_add2_insn (mode)
  2541.      enum machine_mode mode;
  2542. {
  2543.   return add_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing;
  2544. }
  2545.  
  2546. /* Generate and return an insn body to subtract Y from X.  */
  2547.  
  2548. rtx
  2549. gen_sub2_insn (x, y)
  2550.      rtx x, y;
  2551. {
  2552.   int icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code; 
  2553.  
  2554.   if (! (*insn_operand_predicate[icode][0]) (x, insn_operand_mode[icode][0])
  2555.       || ! (*insn_operand_predicate[icode][1]) (x, insn_operand_mode[icode][1])
  2556.       || ! (*insn_operand_predicate[icode][2]) (y, insn_operand_mode[icode][2]))
  2557.     abort ();
  2558.  
  2559.   return (GEN_FCN (icode) (x, x, y));
  2560. }
  2561.  
  2562. int
  2563. have_sub2_insn (mode)
  2564.      enum machine_mode mode;
  2565. {
  2566.   return sub_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing;
  2567. }
  2568.  
  2569. /* Generate the body of an instruction to copy Y into X.  */
  2570.  
  2571. rtx
  2572. gen_move_insn (x, y)
  2573.      rtx x, y;
  2574. {
  2575.   register enum machine_mode mode = GET_MODE (x);
  2576.   enum insn_code insn_code;
  2577.  
  2578.   if (mode == VOIDmode)
  2579.     mode = GET_MODE (y); 
  2580.  
  2581.   insn_code = mov_optab->handlers[(int) mode].insn_code;
  2582.  
  2583.   /* Handle MODE_CC modes:  If we don't have a special move insn for this mode,
  2584.      find a mode to do it in.  If we have a movcc, use it.  Otherwise,
  2585.      find the MODE_INT mode of the same width.  */
  2586.  
  2587.   if (insn_code == CODE_FOR_nothing)
  2588.     {
  2589.       enum machine_mode tmode = VOIDmode;
  2590.       rtx x1 = x, y1 = y;
  2591.  
  2592.       if (GET_MODE_CLASS (mode) == MODE_CC && mode != CCmode
  2593.       && mov_optab->handlers[(int) CCmode].insn_code != CODE_FOR_nothing)
  2594.     tmode = CCmode;
  2595.       else if (GET_MODE_CLASS (mode) == MODE_CC)
  2596.     for (tmode = QImode; tmode != VOIDmode;
  2597.          tmode = GET_MODE_WIDER_MODE (tmode))
  2598.       if (GET_MODE_SIZE (tmode) == GET_MODE_SIZE (mode))
  2599.         break;
  2600.  
  2601.       if (tmode == VOIDmode)
  2602.     abort ();
  2603.  
  2604.       /* Get X and Y in TMODE.  We can't use gen_lowpart here because it
  2605.      may call change_address which is not appropriate if we were
  2606.      called when a reload was in progress.  We don't have to worry
  2607.      about changing the address since the size in bytes is supposed to
  2608.      be the same.  Copy the MEM to change the mode and move any
  2609.      substitutions from the old MEM to the new one.  */
  2610.  
  2611.       if (reload_in_progress)
  2612.     {
  2613.       x = gen_lowpart_common (tmode, x1);
  2614.       if (x == 0 && GET_CODE (x1) == MEM)
  2615.         {
  2616.           x = gen_rtx (MEM, tmode, XEXP (x1, 0));
  2617.           RTX_UNCHANGING_P (x) = RTX_UNCHANGING_P (x1);
  2618.           MEM_IN_STRUCT_P (x) = MEM_IN_STRUCT_P (x1);
  2619.           MEM_VOLATILE_P (x) = MEM_VOLATILE_P (x1);
  2620.           copy_replacements (x1, x);
  2621.         }
  2622.  
  2623.       y = gen_lowpart_common (tmode, y1);
  2624.       if (y == 0 && GET_CODE (y1) == MEM)
  2625.         {
  2626.           y = gen_rtx (MEM, tmode, XEXP (y1, 0));
  2627.           RTX_UNCHANGING_P (y) = RTX_UNCHANGING_P (y1);
  2628.           MEM_IN_STRUCT_P (y) = MEM_IN_STRUCT_P (y1);
  2629.           MEM_VOLATILE_P (y) = MEM_VOLATILE_P (y1);
  2630.           copy_replacements (y1, y);
  2631.         }
  2632.     }
  2633.       else
  2634.     {
  2635.       x = gen_lowpart (tmode, x);
  2636.       y = gen_lowpart (tmode, y);
  2637.     }
  2638.       
  2639.       insn_code = mov_optab->handlers[(int) tmode].insn_code;
  2640.     }
  2641.  
  2642.   return (GEN_FCN (insn_code) (x, y));
  2643. }
  2644.  
  2645. /* Tables of patterns for extending one integer mode to another.  */
  2646. static enum insn_code extendtab[MAX_MACHINE_MODE][MAX_MACHINE_MODE][2];
  2647.  
  2648. /* Return the insn code used to extend FROM_MODE to TO_MODE.
  2649.    UNSIGNEDP specifies zero-extension instead of sign-extension.  If
  2650.    no such operation exists, CODE_FOR_nothing will be returned.  */
  2651.  
  2652. enum insn_code
  2653. can_extend_p (to_mode, from_mode, unsignedp)
  2654.      enum machine_mode to_mode, from_mode;
  2655.      int unsignedp;
  2656. {
  2657.   return extendtab[(int) to_mode][(int) from_mode][unsignedp];
  2658. }
  2659.  
  2660. /* Generate the body of an insn to extend Y (with mode MFROM)
  2661.    into X (with mode MTO).  Do zero-extension if UNSIGNEDP is nonzero.  */
  2662.  
  2663. rtx
  2664. gen_extend_insn (x, y, mto, mfrom, unsignedp)
  2665.      rtx x, y;
  2666.      enum machine_mode mto, mfrom;
  2667.      int unsignedp;
  2668. {
  2669.   return (GEN_FCN (extendtab[(int) mto][(int) mfrom][unsignedp]) (x, y));
  2670. }
  2671.  
  2672. static void
  2673. init_extends ()
  2674. {
  2675.   enum insn_code *p;
  2676.  
  2677.   for (p = extendtab[0][0];
  2678.        p < extendtab[0][0] + sizeof extendtab / sizeof extendtab[0][0][0];
  2679.        p++)
  2680.     *p = CODE_FOR_nothing;
  2681.  
  2682. #ifdef HAVE_extendditi2
  2683.   if (HAVE_extendditi2)
  2684.     extendtab[(int) TImode][(int) DImode][0] = CODE_FOR_extendditi2;
  2685. #endif
  2686. #ifdef HAVE_extendsiti2
  2687.   if (HAVE_extendsiti2)
  2688.     extendtab[(int) TImode][(int) SImode][0] = CODE_FOR_extendsiti2;
  2689. #endif
  2690. #ifdef HAVE_extendhiti2
  2691.   if (HAVE_extendhiti2)
  2692.     extendtab[(int) TImode][(int) HImode][0] = CODE_FOR_extendhiti2;
  2693. #endif
  2694. #ifdef HAVE_extendqiti2
  2695.   if (HAVE_extendqiti2)
  2696.     extendtab[(int) TImode][(int) QImode][0] = CODE_FOR_extendqiti2;
  2697. #endif
  2698. #ifdef HAVE_extendsidi2
  2699.   if (HAVE_extendsidi2)
  2700.     extendtab[(int) DImode][(int) SImode][0] = CODE_FOR_extendsidi2;
  2701. #endif
  2702. #ifdef HAVE_extendhidi2
  2703.   if (HAVE_extendhidi2)
  2704.     extendtab[(int) DImode][(int) HImode][0] = CODE_FOR_extendhidi2;
  2705. #endif
  2706. #ifdef HAVE_extendqidi2
  2707.   if (HAVE_extendqidi2)
  2708.     extendtab[(int) DImode][(int) QImode][0] = CODE_FOR_extendqidi2;
  2709. #endif
  2710. #ifdef HAVE_extendhisi2
  2711.   if (HAVE_extendhisi2)
  2712.     extendtab[(int) SImode][(int) HImode][0] = CODE_FOR_extendhisi2;
  2713. #endif
  2714. #ifdef HAVE_extendqisi2
  2715.   if (HAVE_extendqisi2)
  2716.     extendtab[(int) SImode][(int) QImode][0] = CODE_FOR_extendqisi2;
  2717. #endif
  2718. #ifdef HAVE_extendqihi2
  2719.   if (HAVE_extendqihi2)
  2720.     extendtab[(int) HImode][(int) QImode][0] = CODE_FOR_extendqihi2;
  2721. #endif
  2722.  
  2723. #ifdef HAVE_zero_extendditi2
  2724.   if (HAVE_zero_extendsiti2)
  2725.     extendtab[(int) TImode][(int) DImode][1] = CODE_FOR_zero_extendditi2;
  2726. #endif
  2727. #ifdef HAVE_zero_extendsiti2
  2728.   if (HAVE_zero_extendsiti2)
  2729.     extendtab[(int) TImode][(int) SImode][1] = CODE_FOR_zero_extendsiti2;
  2730. #endif
  2731. #ifdef HAVE_zero_extendhiti2
  2732.   if (HAVE_zero_extendhiti2)
  2733.     extendtab[(int) TImode][(int) HImode][1] = CODE_FOR_zero_extendhiti2;
  2734. #endif
  2735. #ifdef HAVE_zero_extendqiti2
  2736.   if (HAVE_zero_extendqiti2)
  2737.     extendtab[(int) TImode][(int) QImode][1] = CODE_FOR_zero_extendqiti2;
  2738. #endif
  2739. #ifdef HAVE_zero_extendsidi2
  2740.   if (HAVE_zero_extendsidi2)
  2741.     extendtab[(int) DImode][(int) SImode][1] = CODE_FOR_zero_extendsidi2;
  2742. #endif
  2743. #ifdef HAVE_zero_extendhidi2
  2744.   if (HAVE_zero_extendhidi2)
  2745.     extendtab[(int) DImode][(int) HImode][1] = CODE_FOR_zero_extendhidi2;
  2746. #endif
  2747. #ifdef HAVE_zero_extendqidi2
  2748.   if (HAVE_zero_extendqidi2)
  2749.     extendtab[(int) DImode][(int) QImode][1] = CODE_FOR_zero_extendqidi2;
  2750. #endif
  2751. #ifdef HAVE_zero_extendhisi2
  2752.   if (HAVE_zero_extendhisi2)
  2753.     extendtab[(int) SImode][(int) HImode][1] = CODE_FOR_zero_extendhisi2;
  2754. #endif
  2755. #ifdef HAVE_zero_extendqisi2
  2756.   if (HAVE_zero_extendqisi2)
  2757.     extendtab[(int) SImode][(int) QImode][1] = CODE_FOR_zero_extendqisi2;
  2758. #endif
  2759. #ifdef HAVE_zero_extendqihi2
  2760.   if (HAVE_zero_extendqihi2)
  2761.     extendtab[(int) HImode][(int) QImode][1] = CODE_FOR_zero_extendqihi2;
  2762. #endif
  2763. }
  2764.  
  2765. /* can_fix_p and can_float_p say whether the target machine
  2766.    can directly convert a given fixed point type to
  2767.    a given floating point type, or vice versa.
  2768.    The returned value is the CODE_FOR_... value to use,
  2769.    or CODE_FOR_nothing if these modes cannot be directly converted.  */
  2770.  
  2771. static enum insn_code fixtab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
  2772. static enum insn_code fixtrunctab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
  2773. static enum insn_code floattab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
  2774.  
  2775. /* *TRUNCP_PTR is set to 1 if it is necessary to output
  2776.    an explicit FTRUNC insn before the fix insn; otherwise 0.  */
  2777.  
  2778. static enum insn_code
  2779. can_fix_p (fixmode, fltmode, unsignedp, truncp_ptr)
  2780.      enum machine_mode fltmode, fixmode;
  2781.      int unsignedp;
  2782.      int *truncp_ptr;
  2783. {
  2784.   *truncp_ptr = 0;
  2785.   if (fixtrunctab[(int) fltmode][(int) fixmode][unsignedp] != CODE_FOR_nothing)
  2786.     return fixtrunctab[(int) fltmode][(int) fixmode][unsignedp];
  2787.  
  2788.   if (ftrunc_optab->handlers[(int) fltmode].insn_code != CODE_FOR_nothing)
  2789.     {
  2790.       *truncp_ptr = 1;
  2791.       return fixtab[(int) fltmode][(int) fixmode][unsignedp];
  2792.     }
  2793.   return CODE_FOR_nothing;
  2794. }
  2795.  
  2796. static enum insn_code
  2797. can_float_p (fltmode, fixmode, unsignedp)
  2798.      enum machine_mode fixmode, fltmode;
  2799.      int unsignedp;
  2800. {
  2801.   return floattab[(int) fltmode][(int) fixmode][unsignedp];
  2802. }
  2803.  
  2804. void
  2805. init_fixtab ()
  2806. {
  2807.   enum insn_code *p;
  2808.   for (p = fixtab[0][0];
  2809.        p < fixtab[0][0] + sizeof fixtab / sizeof (fixtab[0][0][0]); 
  2810.        p++)
  2811.     *p = CODE_FOR_nothing;
  2812.   for (p = fixtrunctab[0][0];
  2813.        p < fixtrunctab[0][0] + sizeof fixtrunctab / sizeof (fixtrunctab[0][0][0]); 
  2814.        p++)
  2815.     *p = CODE_FOR_nothing;
  2816.  
  2817. #ifdef HAVE_fixsfqi2
  2818.   if (HAVE_fixsfqi2)
  2819.     fixtab[(int) SFmode][(int) QImode][0] = CODE_FOR_fixsfqi2;
  2820. #endif
  2821. #ifdef HAVE_fixsfhi2
  2822.   if (HAVE_fixsfhi2)
  2823.     fixtab[(int) SFmode][(int) HImode][0] = CODE_FOR_fixsfhi2;
  2824. #endif
  2825. #ifdef HAVE_fixsfsi2
  2826.   if (HAVE_fixsfsi2)
  2827.     fixtab[(int) SFmode][(int) SImode][0] = CODE_FOR_fixsfsi2;
  2828. #endif
  2829. #ifdef HAVE_fixsfdi2
  2830.   if (HAVE_fixsfdi2)
  2831.     fixtab[(int) SFmode][(int) DImode][0] = CODE_FOR_fixsfdi2;
  2832. #endif
  2833.  
  2834. #ifdef HAVE_fixdfqi2
  2835.   if (HAVE_fixdfqi2)
  2836.     fixtab[(int) DFmode][(int) QImode][0] = CODE_FOR_fixdfqi2;
  2837. #endif
  2838. #ifdef HAVE_fixdfhi2
  2839.   if (HAVE_fixdfhi2)
  2840.     fixtab[(int) DFmode][(int) HImode][0] = CODE_FOR_fixdfhi2;
  2841. #endif
  2842. #ifdef HAVE_fixdfsi2
  2843.   if (HAVE_fixdfsi2)
  2844.     fixtab[(int) DFmode][(int) SImode][0] = CODE_FOR_fixdfsi2;
  2845. #endif
  2846. #ifdef HAVE_fixdfdi2
  2847.   if (HAVE_fixdfdi2)
  2848.     fixtab[(int) DFmode][(int) DImode][0] = CODE_FOR_fixdfdi2;
  2849. #endif
  2850. #ifdef HAVE_fixdfti2
  2851.   if (HAVE_fixdfti2)
  2852.     fixtab[(int) DFmode][(int) TImode][0] = CODE_FOR_fixdfti2;
  2853. #endif
  2854.  
  2855. #ifdef HAVE_fixxfqi2
  2856.   if (HAVE_fixxfqi2)
  2857.     fixtab[(int) XFmode][(int) QImode][0] = CODE_FOR_fixxfqi2;
  2858. #endif
  2859. #ifdef HAVE_fixxfhi2
  2860.   if (HAVE_fixxfhi2)
  2861.     fixtab[(int) XFmode][(int) HImode][0] = CODE_FOR_fixxfhi2;
  2862. #endif
  2863. #ifdef HAVE_fixxfsi2
  2864.   if (HAVE_fixxfsi2)
  2865.     fixtab[(int) XFmode][(int) SImode][0] = CODE_FOR_fixxfsi2;
  2866. #endif
  2867. #ifdef HAVE_fixxfdi2
  2868.   if (HAVE_fixxfdi2)
  2869.     fixtab[(int) XFmode][(int) DImode][0] = CODE_FOR_fixxfdi2;
  2870. #endif
  2871. #ifdef HAVE_fixxfti2
  2872.   if (HAVE_fixxfti2)
  2873.     fixtab[(int) XFmode][(int) TImode][0] = CODE_FOR_fixxfti2;
  2874. #endif
  2875.  
  2876. #ifdef HAVE_fixtfqi2
  2877.   if (HAVE_fixtfqi2)
  2878.     fixtab[(int) TFmode][(int) QImode][0] = CODE_FOR_fixtfqi2;
  2879. #endif
  2880. #ifdef HAVE_fixtfhi2
  2881.   if (HAVE_fixtfhi2)
  2882.     fixtab[(int) TFmode][(int) HImode][0] = CODE_FOR_fixtfhi2;
  2883. #endif
  2884. #ifdef HAVE_fixtfsi2
  2885.   if (HAVE_fixtfsi2)
  2886.     fixtab[(int) TFmode][(int) SImode][0] = CODE_FOR_fixtfsi2;
  2887. #endif
  2888. #ifdef HAVE_fixtfdi2
  2889.   if (HAVE_fixtfdi2)
  2890.     fixtab[(int) TFmode][(int) DImode][0] = CODE_FOR_fixtfdi2;
  2891. #endif
  2892. #ifdef HAVE_fixtfti2
  2893.   if (HAVE_fixtfti2)
  2894.     fixtab[(int) TFmode][(int) TImode][0] = CODE_FOR_fixtfti2;
  2895. #endif
  2896.  
  2897. #ifdef HAVE_fixunssfqi2
  2898.   if (HAVE_fixunssfqi2)
  2899.     fixtab[(int) SFmode][(int) QImode][1] = CODE_FOR_fixunssfqi2;
  2900. #endif
  2901. #ifdef HAVE_fixunssfhi2
  2902.   if (HAVE_fixunssfhi2)
  2903.     fixtab[(int) SFmode][(int) HImode][1] = CODE_FOR_fixunssfhi2;
  2904. #endif
  2905. #ifdef HAVE_fixunssfsi2
  2906.   if (HAVE_fixunssfsi2)
  2907.     fixtab[(int) SFmode][(int) SImode][1] = CODE_FOR_fixunssfsi2;
  2908. #endif
  2909. #ifdef HAVE_fixunssfdi2
  2910.   if (HAVE_fixunssfdi2)
  2911.     fixtab[(int) SFmode][(int) DImode][1] = CODE_FOR_fixunssfdi2;
  2912. #endif
  2913.  
  2914. #ifdef HAVE_fixunsdfqi2
  2915.   if (HAVE_fixunsdfqi2)
  2916.     fixtab[(int) DFmode][(int) QImode][1] = CODE_FOR_fixunsdfqi2;
  2917. #endif
  2918. #ifdef HAVE_fixunsdfhi2
  2919.   if (HAVE_fixunsdfhi2)
  2920.     fixtab[(int) DFmode][(int) HImode][1] = CODE_FOR_fixunsdfhi2;
  2921. #endif
  2922. #ifdef HAVE_fixunsdfsi2
  2923.   if (HAVE_fixunsdfsi2)
  2924.     fixtab[(int) DFmode][(int) SImode][1] = CODE_FOR_fixunsdfsi2;
  2925. #endif
  2926. #ifdef HAVE_fixunsdfdi2
  2927.   if (HAVE_fixunsdfdi2)
  2928.     fixtab[(int) DFmode][(int) DImode][1] = CODE_FOR_fixunsdfdi2;
  2929. #endif
  2930. #ifdef HAVE_fixunsdfti2
  2931.   if (HAVE_fixunsdfti2)
  2932.     fixtab[(int) DFmode][(int) TImode][1] = CODE_FOR_fixunsdfti2;
  2933. #endif
  2934.  
  2935. #ifdef HAVE_fixunsxfqi2
  2936.   if (HAVE_fixunsxfqi2)
  2937.     fixtab[(int) XFmode][(int) QImode][1] = CODE_FOR_fixunsxfqi2;
  2938. #endif
  2939. #ifdef HAVE_fixunsxfhi2
  2940.   if (HAVE_fixunsxfhi2)
  2941.     fixtab[(int) XFmode][(int) HImode][1] = CODE_FOR_fixunsxfhi2;
  2942. #endif
  2943. #ifdef HAVE_fixunsxfsi2
  2944.   if (HAVE_fixunsxfsi2)
  2945.     fixtab[(int) XFmode][(int) SImode][1] = CODE_FOR_fixunsxfsi2;
  2946. #endif
  2947. #ifdef HAVE_fixunsxfdi2
  2948.   if (HAVE_fixunsxfdi2)
  2949.     fixtab[(int) XFmode][(int) DImode][1] = CODE_FOR_fixunsxfdi2;
  2950. #endif
  2951. #ifdef HAVE_fixunsxfti2
  2952.   if (HAVE_fixunsxfti2)
  2953.     fixtab[(int) XFmode][(int) TImode][1] = CODE_FOR_fixunsxfti2;
  2954. #endif
  2955.  
  2956. #ifdef HAVE_fixunstfqi2
  2957.   if (HAVE_fixunstfqi2)
  2958.     fixtab[(int) TFmode][(int) QImode][1] = CODE_FOR_fixunstfqi2;
  2959. #endif
  2960. #ifdef HAVE_fixunstfhi2
  2961.   if (HAVE_fixunstfhi2)
  2962.     fixtab[(int) TFmode][(int) HImode][1] = CODE_FOR_fixunstfhi2;
  2963. #endif
  2964. #ifdef HAVE_fixunstfsi2
  2965.   if (HAVE_fixunstfsi2)
  2966.     fixtab[(int) TFmode][(int) SImode][1] = CODE_FOR_fixunstfsi2;
  2967. #endif
  2968. #ifdef HAVE_fixunstfdi2
  2969.   if (HAVE_fixunstfdi2)
  2970.     fixtab[(int) TFmode][(int) DImode][1] = CODE_FOR_fixunstfdi2;
  2971. #endif
  2972. #ifdef HAVE_fixunstfti2
  2973.   if (HAVE_fixunstfti2)
  2974.     fixtab[(int) TFmode][(int) TImode][1] = CODE_FOR_fixunstfti2;
  2975. #endif
  2976.  
  2977. #ifdef HAVE_fix_truncsfqi2
  2978.   if (HAVE_fix_truncsfqi2)
  2979.     fixtrunctab[(int) SFmode][(int) QImode][0] = CODE_FOR_fix_truncsfqi2;
  2980. #endif
  2981. #ifdef HAVE_fix_truncsfhi2
  2982.   if (HAVE_fix_truncsfhi2)
  2983.     fixtrunctab[(int) SFmode][(int) HImode][0] = CODE_FOR_fix_truncsfhi2;
  2984. #endif
  2985. #ifdef HAVE_fix_truncsfsi2
  2986.   if (HAVE_fix_truncsfsi2)
  2987.     fixtrunctab[(int) SFmode][(int) SImode][0] = CODE_FOR_fix_truncsfsi2;
  2988. #endif
  2989. #ifdef HAVE_fix_truncsfdi2
  2990.   if (HAVE_fix_truncsfdi2)
  2991.     fixtrunctab[(int) SFmode][(int) DImode][0] = CODE_FOR_fix_truncsfdi2;
  2992. #endif
  2993.  
  2994. #ifdef HAVE_fix_truncdfqi2
  2995.   if (HAVE_fix_truncdfqi2)
  2996.     fixtrunctab[(int) DFmode][(int) QImode][0] = CODE_FOR_fix_truncdfqi2;
  2997. #endif
  2998. #ifdef HAVE_fix_truncdfhi2
  2999.   if (HAVE_fix_truncdfhi2)
  3000.     fixtrunctab[(int) DFmode][(int) HImode][0] = CODE_FOR_fix_truncdfhi2;
  3001. #endif
  3002. #ifdef HAVE_fix_truncdfsi2
  3003.   if (HAVE_fix_truncdfsi2)
  3004.     fixtrunctab[(int) DFmode][(int) SImode][0] = CODE_FOR_fix_truncdfsi2;
  3005. #endif
  3006. #ifdef HAVE_fix_truncdfdi2
  3007.   if (HAVE_fix_truncdfdi2)
  3008.     fixtrunctab[(int) DFmode][(int) DImode][0] = CODE_FOR_fix_truncdfdi2;
  3009. #endif
  3010. #ifdef HAVE_fix_truncdfti2
  3011.   if (HAVE_fix_truncdfti2)
  3012.     fixtrunctab[(int) DFmode][(int) TImode][0] = CODE_FOR_fix_truncdfti2;
  3013. #endif
  3014.  
  3015. #ifdef HAVE_fix_truncxfqi2
  3016.   if (HAVE_fix_truncxfqi2)
  3017.     fixtrunctab[(int) XFmode][(int) QImode][0] = CODE_FOR_fix_truncxfqi2;
  3018. #endif
  3019. #ifdef HAVE_fix_truncxfhi2
  3020.   if (HAVE_fix_truncxfhi2)
  3021.     fixtrunctab[(int) XFmode][(int) HImode][0] = CODE_FOR_fix_truncxfhi2;
  3022. #endif
  3023. #ifdef HAVE_fix_truncxfsi2
  3024.   if (HAVE_fix_truncxfsi2)
  3025.     fixtrunctab[(int) XFmode][(int) SImode][0] = CODE_FOR_fix_truncxfsi2;
  3026. #endif
  3027. #ifdef HAVE_fix_truncxfdi2
  3028.   if (HAVE_fix_truncxfdi2)
  3029.     fixtrunctab[(int) XFmode][(int) DImode][0] = CODE_FOR_fix_truncxfdi2;
  3030. #endif
  3031. #ifdef HAVE_fix_truncxfti2
  3032.   if (HAVE_fix_truncxfti2)
  3033.     fixtrunctab[(int) XFmode][(int) TImode][0] = CODE_FOR_fix_truncxfti2;
  3034. #endif
  3035. #ifdef HAVE_fix_trunctfqi2
  3036.   if (HAVE_fix_trunctfqi2)
  3037.     fixtrunctab[(int) TFmode][(int) QImode][0] = CODE_FOR_fix_trunctfqi2;
  3038. #endif
  3039. #ifdef HAVE_fix_trunctfhi2
  3040.   if (HAVE_fix_trunctfhi2)
  3041.     fixtrunctab[(int) TFmode][(int) HImode][0] = CODE_FOR_fix_trunctfhi2;
  3042. #endif
  3043. #ifdef HAVE_fix_trunctfsi2
  3044.   if (HAVE_fix_trunctfsi2)
  3045.     fixtrunctab[(int) TFmode][(int) SImode][0] = CODE_FOR_fix_trunctfsi2;
  3046. #endif
  3047. #ifdef HAVE_fix_trunctfdi2
  3048.   if (HAVE_fix_trunctfdi2)
  3049.     fixtrunctab[(int) TFmode][(int) DImode][0] = CODE_FOR_fix_trunctfdi2;
  3050. #endif
  3051. #ifdef HAVE_fix_trunctfti2
  3052.   if (HAVE_fix_trunctfti2)
  3053.     fixtrunctab[(int) TFmode][(int) TImode][0] = CODE_FOR_fix_trunctfti2;
  3054. #endif
  3055.  
  3056. #ifdef HAVE_fixuns_truncsfqi2
  3057.   if (HAVE_fixuns_truncsfqi2)
  3058.     fixtrunctab[(int) SFmode][(int) QImode][1] = CODE_FOR_fixuns_truncsfqi2;
  3059. #endif
  3060. #ifdef HAVE_fixuns_truncsfhi2
  3061.   if (HAVE_fixuns_truncsfhi2)
  3062.     fixtrunctab[(int) SFmode][(int) HImode][1] = CODE_FOR_fixuns_truncsfhi2;
  3063. #endif
  3064. #ifdef HAVE_fixuns_truncsfsi2
  3065.   if (HAVE_fixuns_truncsfsi2)
  3066.     fixtrunctab[(int) SFmode][(int) SImode][1] = CODE_FOR_fixuns_truncsfsi2;
  3067. #endif
  3068. #ifdef HAVE_fixuns_truncsfdi2
  3069.   if (HAVE_fixuns_truncsfdi2)
  3070.     fixtrunctab[(int) SFmode][(int) DImode][1] = CODE_FOR_fixuns_truncsfdi2;
  3071. #endif
  3072.  
  3073. #ifdef HAVE_fixuns_truncdfqi2
  3074.   if (HAVE_fixuns_truncdfqi2)
  3075.     fixtrunctab[(int) DFmode][(int) QImode][1] = CODE_FOR_fixuns_truncdfqi2;
  3076. #endif
  3077. #ifdef HAVE_fixuns_truncdfhi2
  3078.   if (HAVE_fixuns_truncdfhi2)
  3079.     fixtrunctab[(int) DFmode][(int) HImode][1] = CODE_FOR_fixuns_truncdfhi2;
  3080. #endif
  3081. #ifdef HAVE_fixuns_truncdfsi2
  3082.   if (HAVE_fixuns_truncdfsi2)
  3083.     fixtrunctab[(int) DFmode][(int) SImode][1] = CODE_FOR_fixuns_truncdfsi2;
  3084. #endif
  3085. #ifdef HAVE_fixuns_truncdfdi2
  3086.   if (HAVE_fixuns_truncdfdi2)
  3087.     fixtrunctab[(int) DFmode][(int) DImode][1] = CODE_FOR_fixuns_truncdfdi2;
  3088. #endif
  3089. #ifdef HAVE_fixuns_truncdfti2
  3090.   if (HAVE_fixuns_truncdfti2)
  3091.     fixtrunctab[(int) DFmode][(int) TImode][1] = CODE_FOR_fixuns_truncdfti2;
  3092. #endif
  3093.  
  3094. #ifdef HAVE_fixuns_truncxfqi2
  3095.   if (HAVE_fixuns_truncxfqi2)
  3096.     fixtrunctab[(int) XFmode][(int) QImode][1] = CODE_FOR_fixuns_truncxfqi2;
  3097. #endif
  3098. #ifdef HAVE_fixuns_truncxfhi2
  3099.   if (HAVE_fixuns_truncxfhi2)
  3100.     fixtrunctab[(int) XFmode][(int) HImode][1] = CODE_FOR_fixuns_truncxfhi2;
  3101. #endif
  3102. #ifdef HAVE_fixuns_truncxfsi2
  3103.   if (HAVE_fixuns_truncxfsi2)
  3104.     fixtrunctab[(int) XFmode][(int) SImode][1] = CODE_FOR_fixuns_truncxfsi2;
  3105. #endif
  3106. #ifdef HAVE_fixuns_truncxfdi2
  3107.   if (HAVE_fixuns_truncxfdi2)
  3108.     fixtrunctab[(int) XFmode][(int) DImode][1] = CODE_FOR_fixuns_truncxfdi2;
  3109. #endif
  3110. #ifdef HAVE_fixuns_truncxfti2
  3111.   if (HAVE_fixuns_truncxfti2)
  3112.     fixtrunctab[(int) XFmode][(int) TImode][1] = CODE_FOR_fixuns_truncxfti2;
  3113. #endif
  3114.  
  3115. #ifdef HAVE_fixuns_trunctfqi2
  3116.   if (HAVE_fixuns_trunctfqi2)
  3117.     fixtrunctab[(int) TFmode][(int) QImode][1] = CODE_FOR_fixuns_trunctfqi2;
  3118. #endif
  3119. #ifdef HAVE_fixuns_trunctfhi2
  3120.   if (HAVE_fixuns_trunctfhi2)
  3121.     fixtrunctab[(int) TFmode][(int) HImode][1] = CODE_FOR_fixuns_trunctfhi2;
  3122. #endif
  3123. #ifdef HAVE_fixuns_trunctfsi2
  3124.   if (HAVE_fixuns_trunctfsi2)
  3125.     fixtrunctab[(int) TFmode][(int) SImode][1] = CODE_FOR_fixuns_trunctfsi2;
  3126. #endif
  3127. #ifdef HAVE_fixuns_trunctfdi2
  3128.   if (HAVE_fixuns_trunctfdi2)
  3129.     fixtrunctab[(int) TFmode][(int) DImode][1] = CODE_FOR_fixuns_trunctfdi2;
  3130. #endif
  3131. #ifdef HAVE_fixuns_trunctfti2
  3132.   if (HAVE_fixuns_trunctfti2)
  3133.     fixtrunctab[(int) TFmode][(int) TImode][1] = CODE_FOR_fixuns_trunctfti2;
  3134. #endif
  3135.  
  3136. #ifdef FIXUNS_TRUNC_LIKE_FIX_TRUNC
  3137.   /* This flag says the same insns that convert to a signed fixnum
  3138.      also convert validly to an unsigned one.  */
  3139.   {
  3140.     int i;
  3141.     int j;
  3142.     for (i = 0; i < NUM_MACHINE_MODES; i++)
  3143.       for (j = 0; j < NUM_MACHINE_MODES; j++)
  3144.     fixtrunctab[i][j][1] = fixtrunctab[i][j][0];
  3145.   }
  3146. #endif
  3147. }
  3148.  
  3149. void
  3150. init_floattab ()
  3151. {
  3152.   enum insn_code *p;
  3153.   for (p = floattab[0][0];
  3154.        p < floattab[0][0] + sizeof floattab / sizeof (floattab[0][0][0]); 
  3155.        p++)
  3156.     *p = CODE_FOR_nothing;
  3157.  
  3158. #ifdef HAVE_floatqisf2
  3159.   if (HAVE_floatqisf2)
  3160.     floattab[(int) SFmode][(int) QImode][0] = CODE_FOR_floatqisf2;
  3161. #endif
  3162. #ifdef HAVE_floathisf2
  3163.   if (HAVE_floathisf2)
  3164.     floattab[(int) SFmode][(int) HImode][0] = CODE_FOR_floathisf2;
  3165. #endif
  3166. #ifdef HAVE_floatsisf2
  3167.   if (HAVE_floatsisf2)
  3168.     floattab[(int) SFmode][(int) SImode][0] = CODE_FOR_floatsisf2;
  3169. #endif
  3170. #ifdef HAVE_floatdisf2
  3171.   if (HAVE_floatdisf2)
  3172.     floattab[(int) SFmode][(int) DImode][0] = CODE_FOR_floatdisf2;
  3173. #endif
  3174. #ifdef HAVE_floattisf2
  3175.   if (HAVE_floattisf2)
  3176.     floattab[(int) SFmode][(int) TImode][0] = CODE_FOR_floattisf2;
  3177. #endif
  3178.  
  3179. #ifdef HAVE_floatqidf2
  3180.   if (HAVE_floatqidf2)
  3181.     floattab[(int) DFmode][(int) QImode][0] = CODE_FOR_floatqidf2;
  3182. #endif
  3183. #ifdef HAVE_floathidf2
  3184.   if (HAVE_floathidf2)
  3185.     floattab[(int) DFmode][(int) HImode][0] = CODE_FOR_floathidf2;
  3186. #endif
  3187. #ifdef HAVE_floatsidf2
  3188.   if (HAVE_floatsidf2)
  3189.     floattab[(int) DFmode][(int) SImode][0] = CODE_FOR_floatsidf2;
  3190. #endif
  3191. #ifdef HAVE_floatdidf2
  3192.   if (HAVE_floatdidf2)
  3193.     floattab[(int) DFmode][(int) DImode][0] = CODE_FOR_floatdidf2;
  3194. #endif
  3195. #ifdef HAVE_floattidf2
  3196.   if (HAVE_floattidf2)
  3197.     floattab[(int) DFmode][(int) TImode][0] = CODE_FOR_floattidf2;
  3198. #endif
  3199.  
  3200. #ifdef HAVE_floatqixf2
  3201.   if (HAVE_floatqixf2)
  3202.     floattab[(int) XFmode][(int) QImode][0] = CODE_FOR_floatqixf2;
  3203. #endif
  3204. #ifdef HAVE_floathixf2
  3205.   if (HAVE_floathixf2)
  3206.     floattab[(int) XFmode][(int) HImode][0] = CODE_FOR_floathixf2;
  3207. #endif
  3208. #ifdef HAVE_floatsixf2
  3209.   if (HAVE_floatsixf2)
  3210.     floattab[(int) XFmode][(int) SImode][0] = CODE_FOR_floatsixf2;
  3211. #endif
  3212. #ifdef HAVE_floatdixf2
  3213.   if (HAVE_floatdixf2)
  3214.     floattab[(int) XFmode][(int) DImode][0] = CODE_FOR_floatdixf2;
  3215. #endif
  3216. #ifdef HAVE_floattixf2
  3217.   if (HAVE_floattixf2)
  3218.     floattab[(int) XFmode][(int) TImode][0] = CODE_FOR_floattixf2;
  3219. #endif
  3220.  
  3221. #ifdef HAVE_floatqitf2
  3222.   if (HAVE_floatqitf2)
  3223.     floattab[(int) TFmode][(int) QImode][0] = CODE_FOR_floatqitf2;
  3224. #endif
  3225. #ifdef HAVE_floathitf2
  3226.   if (HAVE_floathitf2)
  3227.     floattab[(int) TFmode][(int) HImode][0] = CODE_FOR_floathitf2;
  3228. #endif
  3229. #ifdef HAVE_floatsitf2
  3230.   if (HAVE_floatsitf2)
  3231.     floattab[(int) TFmode][(int) SImode][0] = CODE_FOR_floatsitf2;
  3232. #endif
  3233. #ifdef HAVE_floatditf2
  3234.   if (HAVE_floatditf2)
  3235.     floattab[(int) TFmode][(int) DImode][0] = CODE_FOR_floatditf2;
  3236. #endif
  3237. #ifdef HAVE_floattitf2
  3238.   if (HAVE_floattitf2)
  3239.     floattab[(int) TFmode][(int) TImode][0] = CODE_FOR_floattitf2;
  3240. #endif
  3241.  
  3242. #ifdef HAVE_floatunsqisf2
  3243.   if (HAVE_floatunsqisf2)
  3244.     floattab[(int) SFmode][(int) QImode][1] = CODE_FOR_floatunsqisf2;
  3245. #endif
  3246. #ifdef HAVE_floatunshisf2
  3247.   if (HAVE_floatunshisf2)
  3248.     floattab[(int) SFmode][(int) HImode][1] = CODE_FOR_floatunshisf2;
  3249. #endif
  3250. #ifdef HAVE_floatunssisf2
  3251.   if (HAVE_floatunssisf2)
  3252.     floattab[(int) SFmode][(int) SImode][1] = CODE_FOR_floatunssisf2;
  3253. #endif
  3254. #ifdef HAVE_floatunsdisf2
  3255.   if (HAVE_floatunsdisf2)
  3256.     floattab[(int) SFmode][(int) DImode][1] = CODE_FOR_floatunsdisf2;
  3257. #endif
  3258. #ifdef HAVE_floatunstisf2
  3259.   if (HAVE_floatunstisf2)
  3260.     floattab[(int) SFmode][(int) TImode][1] = CODE_FOR_floatunstisf2;
  3261. #endif
  3262.  
  3263. #ifdef HAVE_floatunsqidf2
  3264.   if (HAVE_floatunsqidf2)
  3265.     floattab[(int) DFmode][(int) QImode][1] = CODE_FOR_floatunsqidf2;
  3266. #endif
  3267. #ifdef HAVE_floatunshidf2
  3268.   if (HAVE_floatunshidf2)
  3269.     floattab[(int) DFmode][(int) HImode][1] = CODE_FOR_floatunshidf2;
  3270. #endif
  3271. #ifdef HAVE_floatunssidf2
  3272.   if (HAVE_floatunssidf2)
  3273.     floattab[(int) DFmode][(int) SImode][1] = CODE_FOR_floatunssidf2;
  3274. #endif
  3275. #ifdef HAVE_floatunsdidf2
  3276.   if (HAVE_floatunsdidf2)
  3277.     floattab[(int) DFmode][(int) DImode][1] = CODE_FOR_floatunsdidf2;
  3278. #endif
  3279. #ifdef HAVE_floatunstidf2
  3280.   if (HAVE_floatunstidf2)
  3281.     floattab[(int) DFmode][(int) TImode][1] = CODE_FOR_floatunstidf2;
  3282. #endif
  3283.  
  3284. #ifdef HAVE_floatunsqixf2
  3285.   if (HAVE_floatunsqixf2)
  3286.     floattab[(int) XFmode][(int) QImode][1] = CODE_FOR_floatunsqixf2;
  3287. #endif
  3288. #ifdef HAVE_floatunshixf2
  3289.   if (HAVE_floatunshixf2)
  3290.     floattab[(int) XFmode][(int) HImode][1] = CODE_FOR_floatunshixf2;
  3291. #endif
  3292. #ifdef HAVE_floatunssixf2
  3293.   if (HAVE_floatunssixf2)
  3294.     floattab[(int) XFmode][(int) SImode][1] = CODE_FOR_floatunssixf2;
  3295. #endif
  3296. #ifdef HAVE_floatunsdixf2
  3297.   if (HAVE_floatunsdixf2)
  3298.     floattab[(int) XFmode][(int) DImode][1] = CODE_FOR_floatunsdixf2;
  3299. #endif
  3300. #ifdef HAVE_floatunstixf2
  3301.   if (HAVE_floatunstixf2)
  3302.     floattab[(int) XFmode][(int) TImode][1] = CODE_FOR_floatunstixf2;
  3303. #endif
  3304.  
  3305. #ifdef HAVE_floatunsqitf2
  3306.   if (HAVE_floatunsqitf2)
  3307.     floattab[(int) TFmode][(int) QImode][1] = CODE_FOR_floatunsqitf2;
  3308. #endif
  3309. #ifdef HAVE_floatunshitf2
  3310.   if (HAVE_floatunshitf2)
  3311.     floattab[(int) TFmode][(int) HImode][1] = CODE_FOR_floatunshitf2;
  3312. #endif
  3313. #ifdef HAVE_floatunssitf2
  3314.   if (HAVE_floatunssitf2)
  3315.     floattab[(int) TFmode][(int) SImode][1] = CODE_FOR_floatunssitf2;
  3316. #endif
  3317. #ifdef HAVE_floatunsditf2
  3318.   if (HAVE_floatunsditf2)
  3319.     floattab[(int) TFmode][(int) DImode][1] = CODE_FOR_floatunsditf2;
  3320. #endif
  3321. #ifdef HAVE_floatunstitf2
  3322.   if (HAVE_floatunstitf2)
  3323.     floattab[(int) TFmode][(int) TImode][1] = CODE_FOR_floatunstitf2;
  3324. #endif
  3325. }
  3326.  
  3327. /* Generate code to convert FROM to floating point
  3328.    and store in TO.  FROM must be fixed point and not VOIDmode.
  3329.    UNSIGNEDP nonzero means regard FROM as unsigned.
  3330.    Normally this is done by correcting the final value
  3331.    if it is negative.  */
  3332.  
  3333. void
  3334. expand_float (to, from, unsignedp)
  3335.      rtx to, from;
  3336.      int unsignedp;
  3337. {
  3338.   enum insn_code icode;
  3339.   register rtx target = to;
  3340.   enum machine_mode fmode, imode;
  3341.  
  3342.   /* Crash now, because we won't be able to decide which mode to use.  */
  3343.   if (GET_MODE (from) == VOIDmode)
  3344.     abort ();
  3345.  
  3346.   /* Look for an insn to do the conversion.  Do it in the specified
  3347.      modes if possible; otherwise convert either input, output or both to
  3348.      wider mode.  If the integer mode is wider than the mode of FROM,
  3349.      we can do the conversion signed even if the input is unsigned.  */
  3350.  
  3351.   for (imode = GET_MODE (from); imode != VOIDmode;
  3352.        imode = GET_MODE_WIDER_MODE (imode))
  3353.     for (fmode = GET_MODE (to); fmode != VOIDmode;
  3354.      fmode = GET_MODE_WIDER_MODE (fmode))
  3355.       {
  3356.     int doing_unsigned = unsignedp;
  3357.  
  3358.     icode = can_float_p (fmode, imode, unsignedp);
  3359.     if (icode == CODE_FOR_nothing && imode != GET_MODE (from) && unsignedp)
  3360.       icode = can_float_p (fmode, imode, 0), doing_unsigned = 0;
  3361.  
  3362.     if (icode != CODE_FOR_nothing)
  3363.       {
  3364.         to = protect_from_queue (to, 1);
  3365.         from = protect_from_queue (from, 0);
  3366.  
  3367.         if (imode != GET_MODE (from))
  3368.           from = convert_to_mode (imode, from, unsignedp);
  3369.  
  3370.         if (fmode != GET_MODE (to))
  3371.           target = gen_reg_rtx (fmode);
  3372.  
  3373.         emit_unop_insn (icode, target, from,
  3374.                 doing_unsigned ? UNSIGNED_FLOAT : FLOAT);
  3375.  
  3376.         if (target != to)
  3377.           convert_move (to, target, 0);
  3378.         return;
  3379.       }
  3380.     }
  3381.  
  3382. #if !defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
  3383.  
  3384.   /* Unsigned integer, and no way to convert directly.
  3385.      Convert as signed, then conditionally adjust the result.  */
  3386.   if (unsignedp)
  3387.     {
  3388.       rtx label = gen_label_rtx ();
  3389.       rtx temp;
  3390.       REAL_VALUE_TYPE offset;
  3391.  
  3392.       emit_queue ();
  3393.  
  3394.       to = protect_from_queue (to, 1);
  3395.       from = protect_from_queue (from, 0);
  3396.  
  3397.       if (flag_force_mem)
  3398.     from = force_not_mem (from);
  3399.  
  3400.       /* If we are about to do some arithmetic to correct for an
  3401.      unsigned operand, do it in a pseudo-register.  */
  3402.  
  3403.       if (GET_CODE (to) != REG || REGNO (to) <= LAST_VIRTUAL_REGISTER)
  3404.     target = gen_reg_rtx (GET_MODE (to));
  3405.  
  3406.       /* Convert as signed integer to floating.  */
  3407.       expand_float (target, from, 0);
  3408.  
  3409.       /* If FROM is negative (and therefore TO is negative),
  3410.      correct its value by 2**bitwidth.  */
  3411.  
  3412.       do_pending_stack_adjust ();
  3413.       emit_cmp_insn (from, const0_rtx, GE, NULL_RTX, GET_MODE (from), 0, 0);
  3414.       emit_jump_insn (gen_bge (label));
  3415.       /* On SCO 3.2.1, ldexp rejects values outside [0.5, 1).
  3416.      Rather than setting up a dconst_dot_5, let's hope SCO
  3417.      fixes the bug.  */
  3418.       offset = REAL_VALUE_LDEXP (dconst1, GET_MODE_BITSIZE (GET_MODE (from)));
  3419.       temp = expand_binop (GET_MODE (to), add_optab, target,
  3420.                immed_real_const_1 (offset, GET_MODE (to)),
  3421.                target, 0, OPTAB_LIB_WIDEN);
  3422.       if (temp != target)
  3423.     emit_move_insn (target, temp);
  3424.       do_pending_stack_adjust ();
  3425.       emit_label (label);
  3426.     }
  3427.   else
  3428. #endif
  3429.  
  3430.   /* No hardware instruction available; call a library rotine to convert from
  3431.      SImode, DImode, or TImode into SFmode, DFmode, XFmode, or TFmode.  */
  3432.     {
  3433.       rtx libfcn;
  3434.       rtx insns;
  3435.  
  3436.       to = protect_from_queue (to, 1);
  3437.       from = protect_from_queue (from, 0);
  3438.  
  3439.       if (GET_MODE_SIZE (GET_MODE (from)) < GET_MODE_SIZE (SImode))
  3440.     from = convert_to_mode (SImode, from, unsignedp);
  3441.  
  3442.       if (flag_force_mem)
  3443.     from = force_not_mem (from);
  3444.  
  3445.       if (GET_MODE (to) == SFmode)
  3446.     {
  3447.       if (GET_MODE (from) == SImode)
  3448.         libfcn = floatsisf_libfunc;
  3449.       else if (GET_MODE (from) == DImode)
  3450.         libfcn = floatdisf_libfunc;
  3451.       else if (GET_MODE (from) == TImode)
  3452.         libfcn = floattisf_libfunc;
  3453.       else
  3454.         abort ();
  3455.     }
  3456.       else if (GET_MODE (to) == DFmode)
  3457.     {
  3458.       if (GET_MODE (from) == SImode)
  3459.         libfcn = floatsidf_libfunc;
  3460.       else if (GET_MODE (from) == DImode)
  3461.         libfcn = floatdidf_libfunc;
  3462.       else if (GET_MODE (from) == TImode)
  3463.         libfcn = floattidf_libfunc;
  3464.       else
  3465.         abort ();
  3466.     }
  3467.       else if (GET_MODE (to) == XFmode)
  3468.     {
  3469.       if (GET_MODE (from) == SImode)
  3470.         libfcn = floatsixf_libfunc;
  3471.       else if (GET_MODE (from) == DImode)
  3472.         libfcn = floatdixf_libfunc;
  3473.       else if (GET_MODE (from) == TImode)
  3474.         libfcn = floattixf_libfunc;
  3475.       else
  3476.         abort ();
  3477.     }
  3478.       else if (GET_MODE (to) == TFmode)
  3479.     {
  3480.       if (GET_MODE (from) == SImode)
  3481.         libfcn = floatsitf_libfunc;
  3482.       else if (GET_MODE (from) == DImode)
  3483.         libfcn = floatditf_libfunc;
  3484.       else if (GET_MODE (from) == TImode)
  3485.         libfcn = floattitf_libfunc;
  3486.       else
  3487.         abort ();
  3488.     }
  3489.       else
  3490.     abort ();
  3491.  
  3492.       start_sequence ();
  3493.  
  3494.       emit_library_call (libfcn, 1, GET_MODE (to), 1, from, GET_MODE (from));
  3495.       insns = get_insns ();
  3496.       end_sequence ();
  3497.  
  3498.       emit_libcall_block (insns, target, hard_libcall_value (GET_MODE (to)),
  3499.               gen_rtx (FLOAT, GET_MODE (to), from));
  3500.     }
  3501.  
  3502.   /* Copy result to requested destination
  3503.      if we have been computing in a temp location.  */
  3504.  
  3505.   if (target != to)
  3506.     {
  3507.       if (GET_MODE (target) == GET_MODE (to))
  3508.     emit_move_insn (to, target);
  3509.       else
  3510.     convert_move (to, target, 0);
  3511.     }
  3512. }
  3513.  
  3514. /* expand_fix: generate code to convert FROM to fixed point
  3515.    and store in TO.  FROM must be floating point.  */
  3516.  
  3517. static rtx
  3518. ftruncify (x)
  3519.      rtx x;
  3520. {
  3521.   rtx temp = gen_reg_rtx (GET_MODE (x));
  3522.   return expand_unop (GET_MODE (x), ftrunc_optab, x, temp, 0);
  3523. }
  3524.  
  3525. void
  3526. expand_fix (to, from, unsignedp)
  3527.      register rtx to, from;
  3528.      int unsignedp;
  3529. {
  3530.   enum insn_code icode;
  3531.   register rtx target = to;
  3532.   enum machine_mode fmode, imode;
  3533.   int must_trunc = 0;
  3534.   rtx libfcn = 0;
  3535.  
  3536.   /* We first try to find a pair of modes, one real and one integer, at
  3537.      least as wide as FROM and TO, respectively, in which we can open-code
  3538.      this conversion.  If the integer mode is wider than the mode of TO,
  3539.      we can do the conversion either signed or unsigned.  */
  3540.  
  3541.   for (imode = GET_MODE (to); imode != VOIDmode;
  3542.        imode = GET_MODE_WIDER_MODE (imode))
  3543.     for (fmode = GET_MODE (from); fmode != VOIDmode;
  3544.      fmode = GET_MODE_WIDER_MODE (fmode))
  3545.       {
  3546.     int doing_unsigned = unsignedp;
  3547.  
  3548.     icode = can_fix_p (imode, fmode, unsignedp, &must_trunc);
  3549.     if (icode == CODE_FOR_nothing && imode != GET_MODE (to) && unsignedp)
  3550.       icode = can_fix_p (imode, fmode, 0, &must_trunc), doing_unsigned = 0;
  3551.  
  3552.     if (icode != CODE_FOR_nothing)
  3553.       {
  3554.         to = protect_from_queue (to, 1);
  3555.         from = protect_from_queue (from, 0);
  3556.  
  3557.         if (fmode != GET_MODE (from))
  3558.           from = convert_to_mode (fmode, from, 0);
  3559.  
  3560.         if (must_trunc)
  3561.           from = ftruncify (from);
  3562.  
  3563.         if (imode != GET_MODE (to))
  3564.           target = gen_reg_rtx (imode);
  3565.  
  3566.         emit_unop_insn (icode, target, from,
  3567.                 doing_unsigned ? UNSIGNED_FIX : FIX);
  3568.         if (target != to)
  3569.           convert_move (to, target, unsignedp);
  3570.         return;
  3571.       }
  3572.       }
  3573.  
  3574. #if !defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
  3575.   /* For an unsigned conversion, there is one more way to do it.
  3576.      If we have a signed conversion, we generate code that compares
  3577.      the real value to the largest representable positive number.  If if
  3578.      is smaller, the conversion is done normally.  Otherwise, subtract
  3579.      one plus the highest signed number, convert, and add it back.
  3580.  
  3581.      We only need to check all real modes, since we know we didn't find
  3582.      anything with a wider integer mode.  */
  3583.  
  3584.   if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_WIDE_INT)
  3585.     for (fmode = GET_MODE (from); fmode != VOIDmode;
  3586.      fmode = GET_MODE_WIDER_MODE (fmode))
  3587.       /* Make sure we won't lose significant bits doing this.  */
  3588.       if (GET_MODE_BITSIZE (fmode) > GET_MODE_BITSIZE (GET_MODE (to))
  3589.       && CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0,
  3590.                         &must_trunc))
  3591.     {
  3592.       int bitsize = GET_MODE_BITSIZE (GET_MODE (to));
  3593.       REAL_VALUE_TYPE offset = REAL_VALUE_LDEXP (dconst1, bitsize - 1);
  3594.       rtx limit = immed_real_const_1 (offset, fmode);
  3595.       rtx lab1 = gen_label_rtx ();
  3596.       rtx lab2 = gen_label_rtx ();
  3597.       rtx insn;
  3598.  
  3599.       emit_queue ();
  3600.       to = protect_from_queue (to, 1);
  3601.       from = protect_from_queue (from, 0);
  3602.  
  3603.       if (flag_force_mem)
  3604.         from = force_not_mem (from);
  3605.  
  3606.       if (fmode != GET_MODE (from))
  3607.         from = convert_to_mode (fmode, from, 0);
  3608.  
  3609.       /* See if we need to do the subtraction.  */
  3610.       do_pending_stack_adjust ();
  3611.       emit_cmp_insn (from, limit, GE, NULL_RTX, GET_MODE (from), 0, 0);
  3612.       emit_jump_insn (gen_bge (lab1));
  3613.  
  3614.       /* If not, do the signed "fix" and branch around fixup code.  */
  3615.       expand_fix (to, from, 0);
  3616.       emit_jump_insn (gen_jump (lab2));
  3617.       emit_barrier ();
  3618.  
  3619.       /* Otherwise, subtract 2**(N-1), convert to signed number,
  3620.          then add 2**(N-1).  Do the addition using XOR since this
  3621.          will often generate better code.  */
  3622.       emit_label (lab1);
  3623.       target = expand_binop (GET_MODE (from), sub_optab, from, limit,
  3624.                  NULL_RTX, 0, OPTAB_LIB_WIDEN);
  3625.       expand_fix (to, target, 0);
  3626.       target = expand_binop (GET_MODE (to), xor_optab, to,
  3627.                  GEN_INT ((HOST_WIDE_INT) 1 << (bitsize - 1)),
  3628.                  to, 1, OPTAB_LIB_WIDEN);
  3629.  
  3630.       if (target != to)
  3631.         emit_move_insn (to, target);
  3632.  
  3633.       emit_label (lab2);
  3634.  
  3635.       /* Make a place for a REG_NOTE and add it.  */
  3636.       insn = emit_move_insn (to, to);
  3637.       REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL,
  3638.                       gen_rtx (UNSIGNED_FIX, GET_MODE (to),
  3639.                            from), REG_NOTES (insn));
  3640.  
  3641.       return;
  3642.     }
  3643. #endif
  3644.  
  3645.   /* We can't do it with an insn, so use a library call.  But first ensure
  3646.      that the mode of TO is at least as wide as SImode, since those are the
  3647.      only library calls we know about.  */
  3648.  
  3649.   if (GET_MODE_SIZE (GET_MODE (to)) < GET_MODE_SIZE (SImode))
  3650.     {
  3651.       target = gen_reg_rtx (SImode);
  3652.  
  3653.       expand_fix (target, from, unsignedp);
  3654.     }
  3655.   else if (GET_MODE (from) == SFmode)
  3656.     {
  3657.       if (GET_MODE (to) == SImode)
  3658.     libfcn = unsignedp ? fixunssfsi_libfunc : fixsfsi_libfunc;
  3659.       else if (GET_MODE (to) == DImode)
  3660.     libfcn = unsignedp ? fixunssfdi_libfunc : fixsfdi_libfunc;
  3661.       else if (GET_MODE (to) == TImode)
  3662.     libfcn = unsignedp ? fixunssfti_libfunc : fixsfti_libfunc;
  3663.       else
  3664.     abort ();
  3665.     }
  3666.   else if (GET_MODE (from) == DFmode)
  3667.     {
  3668.       if (GET_MODE (to) == SImode)
  3669.     libfcn = unsignedp ? fixunsdfsi_libfunc : fixdfsi_libfunc;
  3670.       else if (GET_MODE (to) == DImode)
  3671.     libfcn = unsignedp ? fixunsdfdi_libfunc : fixdfdi_libfunc;
  3672.       else if (GET_MODE (to) == TImode)
  3673.     libfcn = unsignedp ? fixunsdfti_libfunc : fixdfti_libfunc;
  3674.       else
  3675.     abort ();
  3676.     }
  3677.   else if (GET_MODE (from) == XFmode)
  3678.     {
  3679.       if (GET_MODE (to) == SImode)
  3680.     libfcn = unsignedp ? fixunsxfsi_libfunc : fixxfsi_libfunc;
  3681.       else if (GET_MODE (to) == DImode)
  3682.     libfcn = unsignedp ? fixunsxfdi_libfunc : fixxfdi_libfunc;
  3683.       else if (GET_MODE (to) == TImode)
  3684.     libfcn = unsignedp ? fixunsxfti_libfunc : fixxfti_libfunc;
  3685.       else
  3686.     abort ();
  3687.     }
  3688.   else if (GET_MODE (from) == TFmode)
  3689.     {
  3690.       if (GET_MODE (to) == SImode)
  3691.     libfcn = unsignedp ? fixunstfsi_libfunc : fixtfsi_libfunc;
  3692.       else if (GET_MODE (to) == DImode)
  3693.     libfcn = unsignedp ? fixunstfdi_libfunc : fixtfdi_libfunc;
  3694.       else if (GET_MODE (to) == TImode)
  3695.     libfcn = unsignedp ? fixunstfti_libfunc : fixtfti_libfunc;
  3696.       else
  3697.     abort ();
  3698.     }
  3699.   else
  3700.     abort ();
  3701.  
  3702.   if (libfcn)
  3703.     {
  3704.       rtx insns;
  3705.  
  3706.       to = protect_from_queue (to, 1);
  3707.       from = protect_from_queue (from, 0);
  3708.  
  3709.       if (flag_force_mem)
  3710.     from = force_not_mem (from);
  3711.  
  3712.       start_sequence ();
  3713.  
  3714.       emit_library_call (libfcn, 1, GET_MODE (to), 1, from, GET_MODE (from));
  3715.       insns = get_insns ();
  3716.       end_sequence ();
  3717.  
  3718.       emit_libcall_block (insns, target, hard_libcall_value (GET_MODE (to)),
  3719.               gen_rtx (unsignedp ? FIX : UNSIGNED_FIX,
  3720.                    GET_MODE (to), from));
  3721.     }
  3722.       
  3723.   if (GET_MODE (to) == GET_MODE (target))
  3724.     emit_move_insn (to, target);
  3725.   else
  3726.     convert_move (to, target, 0);
  3727. }
  3728.  
  3729. static optab
  3730. init_optab (code)
  3731.      enum rtx_code code;
  3732. {
  3733.   int i;
  3734.   optab op = (optab) xmalloc (sizeof (struct optab));
  3735.   op->code = code;
  3736.   for (i = 0; i < NUM_MACHINE_MODES; i++)
  3737.     {
  3738.       op->handlers[i].insn_code = CODE_FOR_nothing;
  3739.       op->handlers[i].libfunc = 0;
  3740.     }
  3741.   return op;
  3742. }
  3743.  
  3744. /* Initialize the libfunc fields of an entire group of entries in some
  3745.    optab.  Each entry is set equal to a string consisting of a leading
  3746.    pair of underscores followed by a generic operation name followed by
  3747.    a mode name (downshifted to lower case) followed by a single character
  3748.    representing the number of operands for the given operation (which is
  3749.    usually one of the characters '2', '3', or '4').
  3750.  
  3751.    OPTABLE is the table in which libfunc fields are to be initialized.
  3752.    FIRST_MODE is the first machine mode index in the given optab to
  3753.      initialize.
  3754.    LAST_MODE is the last machine mode index in the given optab to
  3755.      initialize.
  3756.    OPNAME is the generic (string) name of the operation.
  3757.    SUFFIX is the character which specifies the number of operands for
  3758.      the given generic operation.
  3759. */
  3760.  
  3761. static void
  3762. init_libfuncs (optable, first_mode, last_mode, opname, suffix)
  3763.     register optab optable;
  3764.     register char *opname;
  3765.     register enum machine_mode first_mode;
  3766.     register enum machine_mode last_mode;
  3767.     register char suffix;
  3768. {
  3769.   register enum machine_mode mode;
  3770.   register unsigned opname_len = strlen (opname);
  3771.  
  3772.   for (mode = first_mode; (int) mode <= (int) last_mode;
  3773.        mode = (enum machine_mode) ((int) mode + 1))
  3774.     {
  3775.       register char *mname = mode_name[(int) mode];
  3776.       register unsigned mname_len = strlen (mname);
  3777.       register char *libfunc_name
  3778.     = (char *) xmalloc (2 + opname_len + mname_len + 1 + 1);
  3779.       register char *p;
  3780.       register char *q;
  3781.  
  3782.       p = libfunc_name;
  3783.       *p++ = '_';
  3784.       *p++ = '_';
  3785.       for (q = opname; *q; )
  3786.     *p++ = *q++;
  3787.       for (q = mname; *q; q++)
  3788.     *p++ = tolower (*q);
  3789.       *p++ = suffix;
  3790.       *p++ = '\0';
  3791.       optable->handlers[(int) mode].libfunc
  3792.     = gen_rtx (SYMBOL_REF, TPmode, libfunc_name);
  3793.     }
  3794. }
  3795.  
  3796. /* Initialize the libfunc fields of an entire group of entries in some
  3797.    optab which correspond to all integer mode operations.  The parameters
  3798.    have the same meaning as similarly named ones for the `init_libfuncs'
  3799.    routine.  (See above).  */
  3800.  
  3801. static void
  3802. init_integral_libfuncs (optable, opname, suffix)
  3803.     register optab optable;
  3804.     register char *opname;
  3805.     register char suffix;
  3806. {
  3807.   init_libfuncs (optable, SImode, TImode, opname, suffix);
  3808. }
  3809.  
  3810. /* Initialize the libfunc fields of an entire group of entries in some
  3811.    optab which correspond to all real mode operations.  The parameters
  3812.    have the same meaning as similarly named ones for the `init_libfuncs'
  3813.    routine.  (See above).  */
  3814.  
  3815. static void
  3816. init_floating_libfuncs (optable, opname, suffix)
  3817.     register optab optable;
  3818.     register char *opname;
  3819.     register char suffix;
  3820. {
  3821.   init_libfuncs (optable, SFmode, TFmode, opname, suffix);
  3822. }
  3823.  
  3824. /* Initialize the libfunc fields of an entire group of entries in some
  3825.    optab which correspond to all complex floating modes.  The parameters
  3826.    have the same meaning as similarly named ones for the `init_libfuncs'
  3827.    routine.  (See above).  */
  3828.  
  3829. static void
  3830. init_complex_libfuncs (optable, opname, suffix)
  3831.     register optab optable;
  3832.     register char *opname;
  3833.     register char suffix;
  3834. {
  3835.   init_libfuncs (optable, SCmode, TCmode, opname, suffix);
  3836. }
  3837.  
  3838. /* Call this once to initialize the contents of the optabs
  3839.    appropriately for the current target machine.  */
  3840.  
  3841. void
  3842. init_optabs ()
  3843. {
  3844.   int i;
  3845.  
  3846.   init_fixtab ();
  3847.   init_floattab ();
  3848.   init_extends ();
  3849.  
  3850.   add_optab = init_optab (PLUS);
  3851.   sub_optab = init_optab (MINUS);
  3852.   smul_optab = init_optab (MULT);
  3853.   smul_widen_optab = init_optab (UNKNOWN);
  3854.   umul_widen_optab = init_optab (UNKNOWN);
  3855.   sdiv_optab = init_optab (DIV);
  3856.   sdivmod_optab = init_optab (UNKNOWN);
  3857.   udiv_optab = init_optab (UDIV);
  3858.   udivmod_optab = init_optab (UNKNOWN);
  3859.   smod_optab = init_optab (MOD);
  3860.   umod_optab = init_optab (UMOD);
  3861.   flodiv_optab = init_optab (DIV);
  3862.   ftrunc_optab = init_optab (UNKNOWN);
  3863.   and_optab = init_optab (AND);
  3864.   ior_optab = init_optab (IOR);
  3865.   xor_optab = init_optab (XOR);
  3866.   ashl_optab = init_optab (ASHIFT);
  3867.   ashr_optab = init_optab (ASHIFTRT);
  3868.   lshl_optab = init_optab (LSHIFT);
  3869.   lshr_optab = init_optab (LSHIFTRT);
  3870.   rotl_optab = init_optab (ROTATE);
  3871.   rotr_optab = init_optab (ROTATERT);
  3872.   smin_optab = init_optab (SMIN);
  3873.   smax_optab = init_optab (SMAX);
  3874.   umin_optab = init_optab (UMIN);
  3875.   umax_optab = init_optab (UMAX);
  3876.   mov_optab = init_optab (UNKNOWN);
  3877.   movstrict_optab = init_optab (UNKNOWN);
  3878.   cmp_optab = init_optab (UNKNOWN);
  3879.   ucmp_optab = init_optab (UNKNOWN);
  3880.   tst_optab = init_optab (UNKNOWN);
  3881.   neg_optab = init_optab (NEG);
  3882.   abs_optab = init_optab (ABS);
  3883.   one_cmpl_optab = init_optab (NOT);
  3884.   ffs_optab = init_optab (FFS);
  3885.   sqrt_optab = init_optab (SQRT);
  3886.   /* Initialize the (possibly unused) optabs for elementary functions. */
  3887.   sin_optab = init_optab (SIN);
  3888.   cos_optab = init_optab (COS);
  3889.   tan_optab = init_optab (TAN);
  3890.   asin_optab = init_optab (ASIN);
  3891.   acos_optab = init_optab (ACOS);
  3892.   atan_optab = init_optab (ATAN);
  3893.   sinh_optab = init_optab (SINH);
  3894.   cosh_optab = init_optab (COSH);
  3895.   tanh_optab = init_optab (TANH);
  3896.   exp_optab = init_optab (EXP);
  3897.   log_optab = init_optab (LOG);
  3898.   log10_optab = init_optab (LOG10);
  3899.   strlen_optab = init_optab (UNKNOWN);
  3900.  
  3901. #ifdef PTR_HACK
  3902. #ifdef HAVE_addDP3
  3903.   if (HAVE_addDP3)
  3904.     add_optab->handlers[(int) DPmode].insn_code = CODE_FOR_addDP3;
  3905. #endif
  3906. #endif /* PTR_HACK */
  3907.  
  3908. #ifdef HAVE_addqi3
  3909.   if (HAVE_addqi3)
  3910.     add_optab->handlers[(int) QImode].insn_code = CODE_FOR_addqi3;
  3911. #endif
  3912. #ifdef HAVE_addhi3
  3913.   if (HAVE_addhi3)
  3914.     add_optab->handlers[(int) HImode].insn_code = CODE_FOR_addhi3;
  3915. #endif
  3916. #ifdef HAVE_addpsi3
  3917.   if (HAVE_addpsi3)
  3918.     add_optab->handlers[(int) PSImode].insn_code = CODE_FOR_addpsi3;
  3919. #endif
  3920. #ifdef HAVE_addsi3
  3921.   if (HAVE_addsi3)
  3922.     add_optab->handlers[(int) SImode].insn_code = CODE_FOR_addsi3;
  3923. #endif
  3924. #ifdef HAVE_adddi3
  3925.   if (HAVE_adddi3)
  3926.     add_optab->handlers[(int) DImode].insn_code = CODE_FOR_adddi3;
  3927. #endif
  3928. #ifdef HAVE_addti3
  3929.   if (HAVE_addti3)
  3930.     add_optab->handlers[(int) TImode].insn_code = CODE_FOR_addti3;
  3931. #endif
  3932. #ifdef HAVE_addsf3
  3933.   if (HAVE_addsf3)
  3934.     add_optab->handlers[(int) SFmode].insn_code = CODE_FOR_addsf3;
  3935. #endif
  3936. #ifdef HAVE_adddf3
  3937.   if (HAVE_adddf3)
  3938.     add_optab->handlers[(int) DFmode].insn_code = CODE_FOR_adddf3;
  3939. #endif
  3940. #ifdef HAVE_addxf3
  3941.   if (HAVE_addxf3)
  3942.     add_optab->handlers[(int) XFmode].insn_code = CODE_FOR_addxf3;
  3943. #endif
  3944. #ifdef HAVE_addtf3
  3945.   if (HAVE_addtf3)
  3946.     add_optab->handlers[(int) TFmode].insn_code = CODE_FOR_addtf3;
  3947. #endif
  3948.   init_integral_libfuncs (add_optab, "add", '3');
  3949.   init_floating_libfuncs (add_optab, "add", '3');
  3950.  
  3951. #ifdef PTR_HACK
  3952. #ifdef HAVE_subDP3
  3953.   if (HAVE_subDP3)
  3954.     sub_optab->handlers[(int) DPmode].insn_code = CODE_FOR_subDP3;
  3955. #endif
  3956. #endif /* PTR_HACK */
  3957.  
  3958. #ifdef HAVE_subqi3
  3959.   if (HAVE_subqi3)
  3960.     sub_optab->handlers[(int) QImode].insn_code = CODE_FOR_subqi3;
  3961. #endif
  3962. #ifdef HAVE_subhi3
  3963.   if (HAVE_subhi3)
  3964.     sub_optab->handlers[(int) HImode].insn_code = CODE_FOR_subhi3;
  3965. #endif
  3966. #ifdef HAVE_subpsi3
  3967.   if (HAVE_subpsi3)
  3968.     sub_optab->handlers[(int) PSImode].insn_code = CODE_FOR_subpsi3;
  3969. #endif
  3970. #ifdef HAVE_subsi3
  3971.   if (HAVE_subsi3)
  3972.     sub_optab->handlers[(int) SImode].insn_code = CODE_FOR_subsi3;
  3973. #endif
  3974. #ifdef HAVE_subdi3
  3975.   if (HAVE_subdi3)
  3976.     sub_optab->handlers[(int) DImode].insn_code = CODE_FOR_subdi3;
  3977. #endif
  3978. #ifdef HAVE_subti3
  3979.   if (HAVE_subti3)
  3980.     sub_optab->handlers[(int) TImode].insn_code = CODE_FOR_subti3;
  3981. #endif
  3982. #ifdef HAVE_subsf3
  3983.   if (HAVE_subsf3)
  3984.     sub_optab->handlers[(int) SFmode].insn_code = CODE_FOR_subsf3;
  3985. #endif
  3986. #ifdef HAVE_subdf3
  3987.   if (HAVE_subdf3)
  3988.     sub_optab->handlers[(int) DFmode].insn_code = CODE_FOR_subdf3;
  3989. #endif
  3990. #ifdef HAVE_subxf3
  3991.   if (HAVE_subxf3)
  3992.     sub_optab->handlers[(int) XFmode].insn_code = CODE_FOR_subxf3;
  3993. #endif
  3994. #ifdef HAVE_subtf3
  3995.   if (HAVE_subtf3)
  3996.     sub_optab->handlers[(int) TFmode].insn_code = CODE_FOR_subtf3;
  3997. #endif
  3998.   init_integral_libfuncs (sub_optab, "sub", '3');
  3999.   init_floating_libfuncs (sub_optab, "sub", '3');
  4000.  
  4001. #ifdef HAVE_mulqi3
  4002.   if (HAVE_mulqi3)
  4003.     smul_optab->handlers[(int) QImode].insn_code = CODE_FOR_mulqi3;
  4004. #endif
  4005. #ifdef HAVE_mulhi3
  4006.   if (HAVE_mulhi3)
  4007.     smul_optab->handlers[(int) HImode].insn_code = CODE_FOR_mulhi3;
  4008. #endif
  4009. #ifdef HAVE_mulpsi3
  4010.   if (HAVE_mulpsi3)
  4011.     smul_optab->handlers[(int) PSImode].insn_code = CODE_FOR_mulpsi3;
  4012. #endif
  4013. #ifdef HAVE_mulsi3
  4014.   if (HAVE_mulsi3)
  4015.     smul_optab->handlers[(int) SImode].insn_code = CODE_FOR_mulsi3;
  4016. #endif
  4017. #ifdef HAVE_muldi3
  4018.   if (HAVE_muldi3)
  4019.     smul_optab->handlers[(int) DImode].insn_code = CODE_FOR_muldi3;
  4020. #endif
  4021. #ifdef HAVE_multi3
  4022.   if (HAVE_multi3)
  4023.     smul_optab->handlers[(int) TImode].insn_code = CODE_FOR_multi3;
  4024. #endif
  4025. #ifdef HAVE_mulsf3
  4026.   if (HAVE_mulsf3)
  4027.     smul_optab->handlers[(int) SFmode].insn_code = CODE_FOR_mulsf3;
  4028. #endif
  4029. #ifdef HAVE_muldf3
  4030.   if (HAVE_muldf3)
  4031.     smul_optab->handlers[(int) DFmode].insn_code = CODE_FOR_muldf3;
  4032. #endif
  4033. #ifdef HAVE_mulxf3
  4034.   if (HAVE_mulxf3)
  4035.     smul_optab->handlers[(int) XFmode].insn_code = CODE_FOR_mulxf3;
  4036. #endif
  4037. #ifdef HAVE_multf3
  4038.   if (HAVE_multf3)
  4039.     smul_optab->handlers[(int) TFmode].insn_code = CODE_FOR_multf3;
  4040. #endif
  4041.   init_integral_libfuncs (smul_optab, "mul", '3');
  4042.   init_floating_libfuncs (smul_optab, "mul", '3');
  4043.  
  4044. #ifdef MULSI3_LIBCALL
  4045.   smul_optab->handlers[(int) SImode].libfunc
  4046.     = gen_rtx (SYMBOL_REF, TPmode, MULSI3_LIBCALL);
  4047. #endif
  4048. #ifdef MULDI3_LIBCALL
  4049.   smul_optab->handlers[(int) DImode].libfunc
  4050.     = gen_rtx (SYMBOL_REF, TPmode, MULDI3_LIBCALL);
  4051. #endif
  4052. #ifdef MULTI3_LIBCALL
  4053.   smul_optab->handlers[(int) TImode].libfunc
  4054.     = gen_rtx (SYMBOL_REF, TPmode, MULTI3_LIBCALL);
  4055. #endif
  4056.  
  4057. #ifdef HAVE_mulqihi3
  4058.   if (HAVE_mulqihi3)
  4059.     smul_widen_optab->handlers[(int) HImode].insn_code = CODE_FOR_mulqihi3;
  4060. #endif
  4061. #ifdef HAVE_mulhisi3
  4062.   if (HAVE_mulhisi3)
  4063.     smul_widen_optab->handlers[(int) SImode].insn_code = CODE_FOR_mulhisi3;
  4064. #endif
  4065. #ifdef HAVE_mulsidi3
  4066.   if (HAVE_mulsidi3)
  4067.     smul_widen_optab->handlers[(int) DImode].insn_code = CODE_FOR_mulsidi3;
  4068. #endif
  4069. #ifdef HAVE_mulditi3
  4070.   if (HAVE_mulditi3)
  4071.     smul_widen_optab->handlers[(int) TImode].insn_code = CODE_FOR_mulditi3;
  4072. #endif
  4073.  
  4074. #ifdef HAVE_umulqihi3
  4075.   if (HAVE_umulqihi3)
  4076.     umul_widen_optab->handlers[(int) HImode].insn_code = CODE_FOR_umulqihi3;
  4077. #endif
  4078. #ifdef HAVE_umulhisi3
  4079.   if (HAVE_umulhisi3)
  4080.     umul_widen_optab->handlers[(int) SImode].insn_code = CODE_FOR_umulhisi3;
  4081. #endif
  4082. #ifdef HAVE_umulsidi3
  4083.   if (HAVE_umulsidi3)
  4084.     umul_widen_optab->handlers[(int) DImode].insn_code = CODE_FOR_umulsidi3;
  4085. #endif
  4086. #ifdef HAVE_umulditi3
  4087.   if (HAVE_umulditi3)
  4088.     umul_widen_optab->handlers[(int) TImode].insn_code = CODE_FOR_umulditi3;
  4089. #endif
  4090.  
  4091. #ifdef HAVE_divqi3
  4092.   if (HAVE_divqi3)
  4093.     sdiv_optab->handlers[(int) QImode].insn_code = CODE_FOR_divqi3;
  4094. #endif
  4095. #ifdef HAVE_divhi3
  4096.   if (HAVE_divhi3)
  4097.     sdiv_optab->handlers[(int) HImode].insn_code = CODE_FOR_divhi3;
  4098. #endif
  4099. #ifdef HAVE_divpsi3
  4100.   if (HAVE_divpsi3)
  4101.     sdiv_optab->handlers[(int) PSImode].insn_code = CODE_FOR_divpsi3;
  4102. #endif
  4103. #ifdef HAVE_divsi3
  4104.   if (HAVE_divsi3)
  4105.     sdiv_optab->handlers[(int) SImode].insn_code = CODE_FOR_divsi3;
  4106. #endif
  4107. #ifdef HAVE_divdi3
  4108.   if (HAVE_divdi3)
  4109.     sdiv_optab->handlers[(int) DImode].insn_code = CODE_FOR_divdi3;
  4110. #endif
  4111. #ifdef HAVE_divti3
  4112.   if (HAVE_divti3)
  4113.     sdiv_optab->handlers[(int) TImode].insn_code = CODE_FOR_divti3;
  4114. #endif
  4115.   init_integral_libfuncs (sdiv_optab, "div", '3');
  4116.  
  4117. #ifdef DIVSI3_LIBCALL
  4118.   sdiv_optab->handlers[(int) SImode].libfunc
  4119.     = gen_rtx (SYMBOL_REF, TPmode, DIVSI3_LIBCALL);
  4120. #endif
  4121. #ifdef DIVDI3_LIBCALL
  4122.   sdiv_optab->handlers[(int) DImode].libfunc
  4123.     = gen_rtx (SYMBOL_REF, TPmode, DIVDI3_LIBCALL);
  4124. #endif
  4125. #ifdef DIVTI3_LIBCALL
  4126.   sdiv_optab->handlers[(int) TImode].libfunc
  4127.     = gen_rtx (SYMBOL_REF, TPmode, DIVTI3_LIBCALL);
  4128. #endif
  4129.  
  4130. #ifdef HAVE_udivqi3
  4131.   if (HAVE_udivqi3)
  4132.     udiv_optab->handlers[(int) QImode].insn_code = CODE_FOR_udivqi3;
  4133. #endif
  4134. #ifdef HAVE_udivhi3
  4135.   if (HAVE_udivhi3)
  4136.     udiv_optab->handlers[(int) HImode].insn_code = CODE_FOR_udivhi3;
  4137. #endif
  4138. #ifdef HAVE_udivpsi3
  4139.   if (HAVE_udivpsi3)
  4140.     udiv_optab->handlers[(int) PSImode].insn_code = CODE_FOR_udivpsi3;
  4141. #endif
  4142. #ifdef HAVE_udivsi3
  4143.   if (HAVE_udivsi3)
  4144.     udiv_optab->handlers[(int) SImode].insn_code = CODE_FOR_udivsi3;
  4145. #endif
  4146. #ifdef HAVE_udivdi3
  4147.   if (HAVE_udivdi3)
  4148.     udiv_optab->handlers[(int) DImode].insn_code = CODE_FOR_udivdi3;
  4149. #endif
  4150. #ifdef HAVE_udivti3
  4151.   if (HAVE_udivti3)
  4152.     udiv_optab->handlers[(int) TImode].insn_code = CODE_FOR_udivti3;
  4153. #endif
  4154.   init_integral_libfuncs (udiv_optab, "udiv", '3');
  4155.  
  4156. #ifdef UDIVSI3_LIBCALL
  4157.   udiv_optab->handlers[(int) SImode].libfunc
  4158.     = gen_rtx (SYMBOL_REF, TPmode, UDIVSI3_LIBCALL);
  4159. #endif
  4160. #ifdef UDIVDI3_LIBCALL
  4161.   udiv_optab->handlers[(int) DImode].libfunc
  4162.     = gen_rtx (SYMBOL_REF, TPmode, UDIVDI3_LIBCALL);
  4163. #endif
  4164. #ifdef UDIVTI3_LIBCALL
  4165.   udiv_optab->handlers[(int) TImode].libfunc
  4166.     = gen_rtx (SYMBOL_REF, TPmode, UDIVTI3_LIBCALL);
  4167. #endif
  4168.  
  4169. #ifdef HAVE_divmodqi4
  4170.   if (HAVE_divmodqi4)
  4171.     sdivmod_optab->handlers[(int) QImode].insn_code = CODE_FOR_divmodqi4;
  4172. #endif
  4173. #ifdef HAVE_divmodhi4
  4174.   if (HAVE_divmodhi4)
  4175.     sdivmod_optab->handlers[(int) HImode].insn_code = CODE_FOR_divmodhi4;
  4176. #endif
  4177. #ifdef HAVE_divmodsi4
  4178.   if (HAVE_divmodsi4)
  4179.     sdivmod_optab->handlers[(int) SImode].insn_code = CODE_FOR_divmodsi4;
  4180. #endif
  4181. #ifdef HAVE_divmoddi4
  4182.   if (HAVE_divmoddi4)
  4183.     sdivmod_optab->handlers[(int) DImode].insn_code = CODE_FOR_divmoddi4;
  4184. #endif
  4185. #ifdef HAVE_divmodti4
  4186.   if (HAVE_divmodti4)
  4187.     sdivmod_optab->handlers[(int) TImode].insn_code = CODE_FOR_divmodti4;
  4188. #endif
  4189.   init_integral_libfuncs (sdivmod_optab, "divmod", '4');
  4190.  
  4191. #ifdef HAVE_udivmodqi4
  4192.   if (HAVE_udivmodqi4)
  4193.     udivmod_optab->handlers[(int) QImode].insn_code = CODE_FOR_udivmodqi4;
  4194. #endif
  4195. #ifdef HAVE_udivmodhi4
  4196.   if (HAVE_udivmodhi4)
  4197.     udivmod_optab->handlers[(int) HImode].insn_code = CODE_FOR_udivmodhi4;
  4198. #endif
  4199. #ifdef HAVE_udivmodsi4
  4200.   if (HAVE_udivmodsi4)
  4201.     udivmod_optab->handlers[(int) SImode].insn_code = CODE_FOR_udivmodsi4;
  4202. #endif
  4203. #ifdef HAVE_udivmoddi4
  4204.   if (HAVE_udivmoddi4)
  4205.     udivmod_optab->handlers[(int) DImode].insn_code = CODE_FOR_udivmoddi4;
  4206. #endif
  4207. #ifdef HAVE_udivmodti4
  4208.   if (HAVE_udivmodti4)
  4209.     udivmod_optab->handlers[(int) TImode].insn_code = CODE_FOR_udivmodti4;
  4210. #endif
  4211.   init_integral_libfuncs (udivmod_optab, "udivmod", '4');
  4212.  
  4213. #ifdef HAVE_modqi3
  4214.   if (HAVE_modqi3)
  4215.     smod_optab->handlers[(int) QImode].insn_code = CODE_FOR_modqi3;
  4216. #endif
  4217. #ifdef HAVE_modhi3
  4218.   if (HAVE_modhi3)
  4219.     smod_optab->handlers[(int) HImode].insn_code = CODE_FOR_modhi3;
  4220. #endif
  4221. #ifdef HAVE_modpsi3
  4222.   if (HAVE_modpsi3)
  4223.     smod_optab->handlers[(int) PSImode].insn_code = CODE_FOR_modpsi3;
  4224. #endif
  4225. #ifdef HAVE_modsi3
  4226.   if (HAVE_modsi3)
  4227.     smod_optab->handlers[(int) SImode].insn_code = CODE_FOR_modsi3;
  4228. #endif
  4229. #ifdef HAVE_moddi3
  4230.   if (HAVE_moddi3)
  4231.     smod_optab->handlers[(int) DImode].insn_code = CODE_FOR_moddi3;
  4232. #endif
  4233. #ifdef HAVE_modti3
  4234.   if (HAVE_modti3)
  4235.     smod_optab->handlers[(int) TImode].insn_code = CODE_FOR_modti3;
  4236. #endif
  4237.   init_integral_libfuncs (smod_optab, "mod", '3');
  4238.  
  4239. #ifdef MODSI3_LIBCALL
  4240.   smod_optab->handlers[(int) SImode].libfunc
  4241.     = gen_rtx (SYMBOL_REF, TPmode, MODSI3_LIBCALL);
  4242. #endif
  4243. #ifdef MODDI3_LIBCALL
  4244.   smod_optab->handlers[(int) DImode].libfunc
  4245.     = gen_rtx (SYMBOL_REF, TPmode, MODDI3_LIBCALL);
  4246. #endif
  4247. #ifdef MODTI3_LIBCALL
  4248.   smod_optab->handlers[(int) TImode].libfunc
  4249.     = gen_rtx (SYMBOL_REF, TPmode, MODTI3_LIBCALL);
  4250. #endif
  4251.  
  4252. #ifdef HAVE_umodqi3
  4253.   if (HAVE_umodqi3)
  4254.     umod_optab->handlers[(int) QImode].insn_code = CODE_FOR_umodqi3;
  4255. #endif
  4256. #ifdef HAVE_umodhi3
  4257.   if (HAVE_umodhi3)
  4258.     umod_optab->handlers[(int) HImode].insn_code = CODE_FOR_umodhi3;
  4259. #endif
  4260. #ifdef HAVE_umodpsi3
  4261.   if (HAVE_umodpsi3)
  4262.     umod_optab->handlers[(int) PSImode].insn_code = CODE_FOR_umodpsi3;
  4263. #endif
  4264. #ifdef HAVE_umodsi3
  4265.   if (HAVE_umodsi3)
  4266.     umod_optab->handlers[(int) SImode].insn_code = CODE_FOR_umodsi3;
  4267. #endif
  4268. #ifdef HAVE_umoddi3
  4269.   if (HAVE_umoddi3)
  4270.     umod_optab->handlers[(int) DImode].insn_code = CODE_FOR_umoddi3;
  4271. #endif
  4272. #ifdef HAVE_umodti3
  4273.   if (HAVE_umodti3)
  4274.     umod_optab->handlers[(int) TImode].insn_code = CODE_FOR_umodti3;
  4275. #endif
  4276.   init_integral_libfuncs (umod_optab, "umod", '3');
  4277.  
  4278. #ifdef UMODSI3_LIBCALL
  4279.   umod_optab->handlers[(int) SImode].libfunc
  4280.     = gen_rtx (SYMBOL_REF, TPmode, UMODSI3_LIBCALL);
  4281. #endif
  4282. #ifdef UMODDI3_LIBCALL
  4283.   umod_optab->handlers[(int) DImode].libfunc
  4284.     = gen_rtx (SYMBOL_REF, TPmode, UMODDI3_LIBCALL);
  4285. #endif
  4286. #ifdef UMODTI3_LIBCALL
  4287.   umod_optab->handlers[(int) TImode].libfunc
  4288.     = gen_rtx (SYMBOL_REF, TPmode, UMODTI3_LIBCALL);
  4289. #endif
  4290.  
  4291. #ifdef HAVE_divsf3
  4292.   if (HAVE_divsf3)
  4293.     flodiv_optab->handlers[(int) SFmode].insn_code = CODE_FOR_divsf3;
  4294. #endif
  4295. #ifdef HAVE_divdf3
  4296.   if (HAVE_divdf3)
  4297.     flodiv_optab->handlers[(int) DFmode].insn_code = CODE_FOR_divdf3;
  4298. #endif
  4299. #ifdef HAVE_divxf3
  4300.   if (HAVE_divxf3)
  4301.     flodiv_optab->handlers[(int) XFmode].insn_code = CODE_FOR_divxf3;
  4302. #endif
  4303. #ifdef HAVE_divtf3
  4304.   if (HAVE_divtf3)
  4305.     flodiv_optab->handlers[(int) TFmode].insn_code = CODE_FOR_divtf3;
  4306. #endif
  4307.   init_floating_libfuncs (flodiv_optab, "div", '3');
  4308.  
  4309. #ifdef HAVE_ftruncsf2
  4310.   if (HAVE_ftruncsf2)
  4311.     ftrunc_optab->handlers[(int) SFmode].insn_code = CODE_FOR_ftruncsf2;
  4312. #endif
  4313. #ifdef HAVE_ftruncdf2
  4314.   if (HAVE_ftruncdf2)
  4315.     ftrunc_optab->handlers[(int) DFmode].insn_code = CODE_FOR_ftruncdf2;
  4316. #endif
  4317. #ifdef HAVE_ftruncxf2
  4318.   if (HAVE_ftruncxf2)
  4319.     ftrunc_optab->handlers[(int) XFmode].insn_code = CODE_FOR_ftruncxf2;
  4320. #endif
  4321. #ifdef HAVE_ftrunctf2
  4322.   if (HAVE_ftrunctf2)
  4323.     ftrunc_optab->handlers[(int) TFmode].insn_code = CODE_FOR_ftrunctf2;
  4324. #endif
  4325.   init_floating_libfuncs (ftrunc_optab, "ftrunc", '2');
  4326.  
  4327. #ifdef HAVE_andqi3
  4328.   if (HAVE_andqi3)
  4329.     and_optab->handlers[(int) QImode].insn_code = CODE_FOR_andqi3;
  4330. #endif
  4331. #ifdef HAVE_andhi3
  4332.   if (HAVE_andhi3)
  4333.     and_optab->handlers[(int) HImode].insn_code = CODE_FOR_andhi3;
  4334. #endif
  4335. #ifdef HAVE_andpsi3
  4336.   if (HAVE_andpsi3)
  4337.     and_optab->handlers[(int) PSImode].insn_code = CODE_FOR_andpsi3;
  4338. #endif
  4339. #ifdef HAVE_andsi3
  4340.   if (HAVE_andsi3)
  4341.     and_optab->handlers[(int) SImode].insn_code = CODE_FOR_andsi3;
  4342. #endif
  4343. #ifdef HAVE_anddi3
  4344.   if (HAVE_anddi3)
  4345.     and_optab->handlers[(int) DImode].insn_code = CODE_FOR_anddi3;
  4346. #endif
  4347. #ifdef HAVE_andti3
  4348.   if (HAVE_andti3)
  4349.     and_optab->handlers[(int) TImode].insn_code = CODE_FOR_andti3;
  4350. #endif
  4351.   init_integral_libfuncs (and_optab, "and", '3');
  4352.  
  4353. #ifdef HAVE_iorqi3
  4354.   if (HAVE_iorqi3)
  4355.     ior_optab->handlers[(int) QImode].insn_code = CODE_FOR_iorqi3;
  4356. #endif
  4357. #ifdef HAVE_iorhi3
  4358.   if (HAVE_iorhi3)
  4359.     ior_optab->handlers[(int) HImode].insn_code = CODE_FOR_iorhi3;
  4360. #endif
  4361. #ifdef HAVE_iorpsi3
  4362.   if (HAVE_iorpsi3)
  4363.     ior_optab->handlers[(int) PSImode].insn_code = CODE_FOR_iorpsi3;
  4364. #endif
  4365. #ifdef HAVE_iorsi3
  4366.   if (HAVE_iorsi3)
  4367.     ior_optab->handlers[(int) SImode].insn_code = CODE_FOR_iorsi3;
  4368. #endif
  4369. #ifdef HAVE_iordi3
  4370.   if (HAVE_iordi3)
  4371.     ior_optab->handlers[(int) DImode].insn_code = CODE_FOR_iordi3;
  4372. #endif
  4373. #ifdef HAVE_iorti3
  4374.   if (HAVE_iorti3)
  4375.     ior_optab->handlers[(int) TImode].insn_code = CODE_FOR_iorti3;
  4376. #endif
  4377.   init_integral_libfuncs (ior_optab, "ior", '3');
  4378.  
  4379. #ifdef HAVE_xorqi3
  4380.   if (HAVE_xorqi3)
  4381.     xor_optab->handlers[(int) QImode].insn_code = CODE_FOR_xorqi3;
  4382. #endif
  4383. #ifdef HAVE_xorhi3
  4384.   if (HAVE_xorhi3)
  4385.     xor_optab->handlers[(int) HImode].insn_code = CODE_FOR_xorhi3;
  4386. #endif
  4387. #ifdef HAVE_xorpsi3
  4388.   if (HAVE_xorpsi3)
  4389.     xor_optab->handlers[(int) PSImode].insn_code = CODE_FOR_xorpsi3;
  4390. #endif
  4391. #ifdef HAVE_xorsi3
  4392.   if (HAVE_xorsi3)
  4393.     xor_optab->handlers[(int) SImode].insn_code = CODE_FOR_xorsi3;
  4394. #endif
  4395. #ifdef HAVE_xordi3
  4396.   if (HAVE_xordi3)
  4397.     xor_optab->handlers[(int) DImode].insn_code = CODE_FOR_xordi3;
  4398. #endif
  4399. #ifdef HAVE_xorti3
  4400.   if (HAVE_xorti3)
  4401.     xor_optab->handlers[(int) TImode].insn_code = CODE_FOR_xorti3;
  4402. #endif
  4403.   init_integral_libfuncs (xor_optab, "xor", '3');
  4404.  
  4405. #ifdef HAVE_ashlqi3
  4406.   if (HAVE_ashlqi3)
  4407.     ashl_optab->handlers[(int) QImode].insn_code = CODE_FOR_ashlqi3;
  4408. #endif
  4409. #ifdef HAVE_ashlhi3
  4410.   if (HAVE_ashlhi3)
  4411.     ashl_optab->handlers[(int) HImode].insn_code = CODE_FOR_ashlhi3;
  4412. #endif
  4413. #ifdef HAVE_ashlpsi3
  4414.   if (HAVE_ashlpsi3)
  4415.     ashl_optab->handlers[(int) PSImode].insn_code = CODE_FOR_ashlpsi3;
  4416. #endif
  4417. #ifdef HAVE_ashlsi3
  4418.   if (HAVE_ashlsi3)
  4419.     ashl_optab->handlers[(int) SImode].insn_code = CODE_FOR_ashlsi3;
  4420. #endif
  4421. #ifdef HAVE_ashldi3
  4422.   if (HAVE_ashldi3)
  4423.     ashl_optab->handlers[(int) DImode].insn_code = CODE_FOR_ashldi3;
  4424. #endif
  4425. #ifdef HAVE_ashlti3
  4426.   if (HAVE_ashlti3)
  4427.     ashl_optab->handlers[(int) TImode].insn_code = CODE_FOR_ashlti3;
  4428. #endif
  4429.   init_integral_libfuncs (ashl_optab, "ashl", '3');
  4430.  
  4431. #ifdef HAVE_ashrqi3
  4432.   if (HAVE_ashrqi3)
  4433.     ashr_optab->handlers[(int) QImode].insn_code = CODE_FOR_ashrqi3;
  4434. #endif
  4435. #ifdef HAVE_ashrhi3
  4436.   if (HAVE_ashrhi3)
  4437.     ashr_optab->handlers[(int) HImode].insn_code = CODE_FOR_ashrhi3;
  4438. #endif
  4439. #ifdef HAVE_ashrpsi3
  4440.   if (HAVE_ashrpsi3)
  4441.     ashr_optab->handlers[(int) PSImode].insn_code = CODE_FOR_ashrpsi3;
  4442. #endif
  4443. #ifdef HAVE_ashrsi3
  4444.   if (HAVE_ashrsi3)
  4445.     ashr_optab->handlers[(int) SImode].insn_code = CODE_FOR_ashrsi3;
  4446. #endif
  4447. #ifdef HAVE_ashrdi3
  4448.   if (HAVE_ashrdi3)
  4449.     ashr_optab->handlers[(int) DImode].insn_code = CODE_FOR_ashrdi3;
  4450. #endif
  4451. #ifdef HAVE_ashrti3
  4452.   if (HAVE_ashrti3)
  4453.     ashr_optab->handlers[(int) TImode].insn_code = CODE_FOR_ashrti3;
  4454. #endif
  4455.   init_integral_libfuncs (ashr_optab, "ashr", '3');
  4456.  
  4457. #ifdef HAVE_lshlqi3
  4458.   if (HAVE_lshlqi3)
  4459.     lshl_optab->handlers[(int) QImode].insn_code = CODE_FOR_lshlqi3;
  4460. #endif
  4461. #ifdef HAVE_lshlhi3
  4462.   if (HAVE_lshlhi3)
  4463.     lshl_optab->handlers[(int) HImode].insn_code = CODE_FOR_lshlhi3;
  4464. #endif
  4465. #ifdef HAVE_lshlpsi3
  4466.   if (HAVE_lshlpsi3)
  4467.     lshl_optab->handlers[(int) PSImode].insn_code = CODE_FOR_lshlpsi3;
  4468. #endif
  4469. #ifdef HAVE_lshlsi3
  4470.   if (HAVE_lshlsi3)
  4471.     lshl_optab->handlers[(int) SImode].insn_code = CODE_FOR_lshlsi3;
  4472. #endif
  4473. #ifdef HAVE_lshldi3
  4474.   if (HAVE_lshldi3)
  4475.     lshl_optab->handlers[(int) DImode].insn_code = CODE_FOR_lshldi3;
  4476. #endif
  4477. #ifdef HAVE_lshlti3
  4478.   if (HAVE_lshlti3)
  4479.     lshl_optab->handlers[(int) TImode].insn_code = CODE_FOR_lshlti3;
  4480. #endif
  4481.   init_integral_libfuncs (lshl_optab, "lshl", '3');
  4482.  
  4483. #ifdef HAVE_lshrqi3
  4484.   if (HAVE_lshrqi3)
  4485.     lshr_optab->handlers[(int) QImode].insn_code = CODE_FOR_lshrqi3;
  4486. #endif
  4487. #ifdef HAVE_lshrhi3
  4488.   if (HAVE_lshrhi3)
  4489.     lshr_optab->handlers[(int) HImode].insn_code = CODE_FOR_lshrhi3;
  4490. #endif
  4491. #ifdef HAVE_lshrpsi3
  4492.   if (HAVE_lshrpsi3)
  4493.     lshr_optab->handlers[(int) PSImode].insn_code = CODE_FOR_lshrpsi3;
  4494. #endif
  4495. #ifdef HAVE_lshrsi3
  4496.   if (HAVE_lshrsi3)
  4497.     lshr_optab->handlers[(int) SImode].insn_code = CODE_FOR_lshrsi3;
  4498. #endif
  4499. #ifdef HAVE_lshrdi3
  4500.   if (HAVE_lshrdi3)
  4501.     lshr_optab->handlers[(int) DImode].insn_code = CODE_FOR_lshrdi3;
  4502. #endif
  4503. #ifdef HAVE_lshrti3
  4504.   if (HAVE_lshrti3)
  4505.     lshr_optab->handlers[(int) TImode].insn_code = CODE_FOR_lshrti3;
  4506. #endif
  4507.   init_integral_libfuncs (lshr_optab, "lshr", '3');
  4508.  
  4509. #ifdef HAVE_rotlqi3
  4510.   if (HAVE_rotlqi3)
  4511.     rotl_optab->handlers[(int) QImode].insn_code = CODE_FOR_rotlqi3;
  4512. #endif
  4513. #ifdef HAVE_rotlhi3
  4514.   if (HAVE_rotlhi3)
  4515.     rotl_optab->handlers[(int) HImode].insn_code = CODE_FOR_rotlhi3;
  4516. #endif
  4517. #ifdef HAVE_rotlpsi3
  4518.   if (HAVE_rotlpsi3)
  4519.     rotl_optab->handlers[(int) PSImode].insn_code = CODE_FOR_rotlpsi3;
  4520. #endif
  4521. #ifdef HAVE_rotlsi3
  4522.   if (HAVE_rotlsi3)
  4523.     rotl_optab->handlers[(int) SImode].insn_code = CODE_FOR_rotlsi3;
  4524. #endif
  4525. #ifdef HAVE_rotldi3
  4526.   if (HAVE_rotldi3)
  4527.     rotl_optab->handlers[(int) DImode].insn_code = CODE_FOR_rotldi3;
  4528. #endif
  4529. #ifdef HAVE_rotlti3
  4530.   if (HAVE_rotlti3)
  4531.     rotl_optab->handlers[(int) TImode].insn_code = CODE_FOR_rotlti3;
  4532. #endif
  4533.   init_integral_libfuncs (rotl_optab, "rotl", '3');
  4534.  
  4535. #ifdef HAVE_rotrqi3
  4536.   if (HAVE_rotrqi3)
  4537.     rotr_optab->handlers[(int) QImode].insn_code = CODE_FOR_rotrqi3;
  4538. #endif
  4539. #ifdef HAVE_rotrhi3
  4540.   if (HAVE_rotrhi3)
  4541.     rotr_optab->handlers[(int) HImode].insn_code = CODE_FOR_rotrhi3;
  4542. #endif
  4543. #ifdef HAVE_rotrpsi3
  4544.   if (HAVE_rotrpsi3)
  4545.     rotr_optab->handlers[(int) PSImode].insn_code = CODE_FOR_rotrpsi3;
  4546. #endif
  4547. #ifdef HAVE_rotrsi3
  4548.   if (HAVE_rotrsi3)
  4549.     rotr_optab->handlers[(int) SImode].insn_code = CODE_FOR_rotrsi3;
  4550. #endif
  4551. #ifdef HAVE_rotrdi3
  4552.   if (HAVE_rotrdi3)
  4553.     rotr_optab->handlers[(int) DImode].insn_code = CODE_FOR_rotrdi3;
  4554. #endif
  4555. #ifdef HAVE_rotrti3
  4556.   if (HAVE_rotrti3)
  4557.     rotr_optab->handlers[(int) TImode].insn_code = CODE_FOR_rotrti3;
  4558. #endif
  4559.   init_integral_libfuncs (rotr_optab, "rotr", '3');
  4560.  
  4561. #ifdef HAVE_sminqi3
  4562.   if (HAVE_sminqi3)
  4563.     smin_optab->handlers[(int) QImode].insn_code = CODE_FOR_sminqi3;
  4564. #endif
  4565. #ifdef HAVE_sminhi3
  4566.   if (HAVE_sminhi3)
  4567.     smin_optab->handlers[(int) HImode].insn_code = CODE_FOR_sminhi3;
  4568. #endif
  4569. #ifdef HAVE_sminsi3
  4570.   if (HAVE_sminsi3)
  4571.     smin_optab->handlers[(int) SImode].insn_code = CODE_FOR_sminsi3;
  4572. #endif
  4573. #ifdef HAVE_smindi3
  4574.   if (HAVE_smindi3)
  4575.     smin_optab->handlers[(int) DImode].insn_code = CODE_FOR_smindi3;
  4576. #endif
  4577. #ifdef HAVE_sminti3
  4578.   if (HAVE_sminti3)
  4579.     smin_optab->handlers[(int) TImode].insn_code = CODE_FOR_sminti3;
  4580. #endif
  4581. #ifdef HAVE_minsf3
  4582.   if (HAVE_minsf3)
  4583.     smin_optab->handlers[(int) SFmode].insn_code = CODE_FOR_minsf3;
  4584. #endif
  4585. #ifdef HAVE_mindf3
  4586.   if (HAVE_mindf3)
  4587.     smin_optab->handlers[(int) DFmode].insn_code = CODE_FOR_mindf3;
  4588. #endif
  4589. #ifdef HAVE_minxf3
  4590.   if (HAVE_minxf3)
  4591.     smin_optab->handlers[(int) XFmode].insn_code = CODE_FOR_minxf3;
  4592. #endif
  4593. #ifdef HAVE_mintf3
  4594.   if (HAVE_mintf3)
  4595.     smin_optab->handlers[(int) TFmode].insn_code = CODE_FOR_mintf3;
  4596. #endif
  4597.   init_integral_libfuncs (smin_optab, "min", '3');
  4598.   init_floating_libfuncs (smin_optab, "min", '3');
  4599.  
  4600. #ifdef HAVE_smaxqi3
  4601.   if (HAVE_smaxqi3)
  4602.     smax_optab->handlers[(int) QImode].insn_code = CODE_FOR_smaxqi3;
  4603. #endif
  4604. #ifdef HAVE_smaxhi3
  4605.   if (HAVE_smaxhi3)
  4606.     smax_optab->handlers[(int) HImode].insn_code = CODE_FOR_smaxhi3;
  4607. #endif
  4608. #ifdef HAVE_smaxsi3
  4609.   if (HAVE_smaxsi3)
  4610.     smax_optab->handlers[(int) SImode].insn_code = CODE_FOR_smaxsi3;
  4611. #endif
  4612. #ifdef HAVE_smaxdi3
  4613.   if (HAVE_smaxdi3)
  4614.     smax_optab->handlers[(int) DImode].insn_code = CODE_FOR_smaxdi3;
  4615. #endif
  4616. #ifdef HAVE_smaxti3
  4617.   if (HAVE_smaxti3)
  4618.     smax_optab->handlers[(int) TImode].insn_code = CODE_FOR_smaxti3;
  4619. #endif
  4620. #ifdef HAVE_maxsf3
  4621.   if (HAVE_maxsf3)
  4622.     smax_optab->handlers[(int) SFmode].insn_code = CODE_FOR_maxsf3;
  4623. #endif
  4624. #ifdef HAVE_maxdf3
  4625.   if (HAVE_maxdf3)
  4626.     smax_optab->handlers[(int) DFmode].insn_code = CODE_FOR_maxdf3;
  4627. #endif
  4628. #ifdef HAVE_maxxf3
  4629.   if (HAVE_maxxf3)
  4630.     smax_optab->handlers[(int) XFmode].insn_code = CODE_FOR_maxxf3;
  4631. #endif
  4632. #ifdef HAVE_maxtf3
  4633.   if (HAVE_maxtf3)
  4634.     smax_optab->handlers[(int) TFmode].insn_code = CODE_FOR_maxtf3;
  4635. #endif
  4636.   init_integral_libfuncs (smax_optab, "max", '3');
  4637.   init_floating_libfuncs (smax_optab, "max", '3');
  4638.  
  4639. #ifdef HAVE_uminqi3
  4640.   if (HAVE_uminqi3)
  4641.     umin_optab->handlers[(int) QImode].insn_code = CODE_FOR_uminqi3;
  4642. #endif
  4643. #ifdef HAVE_uminhi3
  4644.   if (HAVE_uminhi3)
  4645.     umin_optab->handlers[(int) HImode].insn_code = CODE_FOR_uminhi3;
  4646. #endif
  4647. #ifdef HAVE_uminsi3
  4648.   if (HAVE_uminsi3)
  4649.     umin_optab->handlers[(int) SImode].insn_code = CODE_FOR_uminsi3;
  4650. #endif
  4651. #ifdef HAVE_umindi3
  4652.   if (HAVE_umindi3)
  4653.     umin_optab->handlers[(int) DImode].insn_code = CODE_FOR_umindi3;
  4654. #endif
  4655. #ifdef HAVE_uminti3
  4656.   if (HAVE_uminti3)
  4657.     umin_optab->handlers[(int) TImode].insn_code = CODE_FOR_uminti3;
  4658. #endif
  4659.   init_integral_libfuncs (umin_optab, "umin", '3');
  4660.  
  4661. #ifdef HAVE_umaxqi3
  4662.   if (HAVE_umaxqi3)
  4663.     umax_optab->handlers[(int) QImode].insn_code = CODE_FOR_umaxqi3;
  4664. #endif
  4665. #ifdef HAVE_umaxhi3
  4666.   if (HAVE_umaxhi3)
  4667.     umax_optab->handlers[(int) HImode].insn_code = CODE_FOR_umaxhi3;
  4668. #endif
  4669. #ifdef HAVE_umaxsi3
  4670.   if (HAVE_umaxsi3)
  4671.     umax_optab->handlers[(int) SImode].insn_code = CODE_FOR_umaxsi3;
  4672. #endif
  4673. #ifdef HAVE_umaxdi3
  4674.   if (HAVE_umaxdi3)
  4675.     umax_optab->handlers[(int) DImode].insn_code = CODE_FOR_umaxdi3;
  4676. #endif
  4677. #ifdef HAVE_umaxti3
  4678.   if (HAVE_umaxti3)
  4679.     umax_optab->handlers[(int) TImode].insn_code = CODE_FOR_umaxti3;
  4680. #endif
  4681.   init_integral_libfuncs (umax_optab, "umax", '3');
  4682.  
  4683. #ifdef HAVE_negqi2
  4684.   if (HAVE_negqi2)
  4685.     neg_optab->handlers[(int) QImode].insn_code = CODE_FOR_negqi2;
  4686. #endif
  4687. #ifdef HAVE_neghi2
  4688.   if (HAVE_neghi2)
  4689.     neg_optab->handlers[(int) HImode].insn_code = CODE_FOR_neghi2;
  4690. #endif
  4691. #ifdef HAVE_negpsi2
  4692.   if (HAVE_negpsi2)
  4693.     neg_optab->handlers[(int) PSImode].insn_code = CODE_FOR_negpsi2;
  4694. #endif
  4695. #ifdef HAVE_negsi2
  4696.   if (HAVE_negsi2)
  4697.     neg_optab->handlers[(int) SImode].insn_code = CODE_FOR_negsi2;
  4698. #endif
  4699. #ifdef HAVE_negdi2
  4700.   if (HAVE_negdi2)
  4701.     neg_optab->handlers[(int) DImode].insn_code = CODE_FOR_negdi2;
  4702. #endif
  4703. #ifdef HAVE_negti2
  4704.   if (HAVE_negti2)
  4705.     neg_optab->handlers[(int) TImode].insn_code = CODE_FOR_negti2;
  4706. #endif
  4707. #ifdef HAVE_negsf2
  4708.   if (HAVE_negsf2)
  4709.     neg_optab->handlers[(int) SFmode].insn_code = CODE_FOR_negsf2;
  4710. #endif
  4711. #ifdef HAVE_negdf2
  4712.   if (HAVE_negdf2)
  4713.     neg_optab->handlers[(int) DFmode].insn_code = CODE_FOR_negdf2;
  4714. #endif
  4715. #ifdef HAVE_negxf2
  4716.   if (HAVE_negxf2)
  4717.     neg_optab->handlers[(int) XFmode].insn_code = CODE_FOR_negxf2;
  4718. #endif
  4719. #ifdef HAVE_negtf2
  4720.   if (HAVE_negtf2)
  4721.     neg_optab->handlers[(int) TFmode].insn_code = CODE_FOR_negtf2;
  4722. #endif
  4723.   init_integral_libfuncs (neg_optab, "neg", '2');
  4724.   init_floating_libfuncs (neg_optab, "neg", '2');
  4725.  
  4726. #ifdef HAVE_absqi2
  4727.   if (HAVE_absqi2)
  4728.     abs_optab->handlers[(int) QImode].insn_code = CODE_FOR_absqi2;
  4729. #endif
  4730. #ifdef HAVE_abshi2
  4731.   if (HAVE_abshi2)
  4732.     abs_optab->handlers[(int) HImode].insn_code = CODE_FOR_abshi2;
  4733. #endif
  4734. #ifdef HAVE_abspsi2
  4735.   if (HAVE_abspsi2)
  4736.     abs_optab->handlers[(int) PSImode].insn_code = CODE_FOR_abspsi2;
  4737. #endif
  4738. #ifdef HAVE_abssi2
  4739.   if (HAVE_abssi2)
  4740.     abs_optab->handlers[(int) SImode].insn_code = CODE_FOR_abssi2;
  4741. #endif
  4742. #ifdef HAVE_absdi2
  4743.   if (HAVE_absdi2)
  4744.     abs_optab->handlers[(int) DImode].insn_code = CODE_FOR_absdi2;
  4745. #endif
  4746. #ifdef HAVE_absti2
  4747.   if (HAVE_absti2)
  4748.     abs_optab->handlers[(int) TImode].insn_code = CODE_FOR_absti2;
  4749. #endif
  4750. #ifdef HAVE_abssf2
  4751.   if (HAVE_abssf2)
  4752.     abs_optab->handlers[(int) SFmode].insn_code = CODE_FOR_abssf2;
  4753. #endif
  4754. #ifdef HAVE_absdf2
  4755.   if (HAVE_absdf2)
  4756.     abs_optab->handlers[(int) DFmode].insn_code = CODE_FOR_absdf2;
  4757. #endif
  4758. #ifdef HAVE_absxf2
  4759.   if (HAVE_absxf2)
  4760.     abs_optab->handlers[(int) XFmode].insn_code = CODE_FOR_absxf2;
  4761. #endif
  4762. #ifdef HAVE_abstf2
  4763.   if (HAVE_abstf2)
  4764.     abs_optab->handlers[(int) TFmode].insn_code = CODE_FOR_abstf2;
  4765. #endif
  4766.  
  4767.   /* Use cabs for DC complex abs, since systems generally have cabs.
  4768.      Don't define any libcall for SCmode, so that cabs will be used.  */
  4769.   abs_optab->handlers[(int) DCmode].libfunc
  4770.     = gen_rtx (SYMBOL_REF, TPmode, "cabs");
  4771.  
  4772. #ifdef HAVE_sqrtqi2
  4773.   if (HAVE_sqrtqi2)
  4774.     sqrt_optab->handlers[(int) QImode].insn_code = CODE_FOR_sqrtqi2;
  4775. #endif
  4776. #ifdef HAVE_sqrthi2
  4777.   if (HAVE_sqrthi2)
  4778.     sqrt_optab->handlers[(int) HImode].insn_code = CODE_FOR_sqrthi2;
  4779. #endif
  4780. #ifdef HAVE_sqrtpsi2
  4781.   if (HAVE_sqrtpsi2)
  4782.     sqrt_optab->handlers[(int) PSImode].insn_code = CODE_FOR_sqrtpsi2;
  4783. #endif
  4784. #ifdef HAVE_sqrtsi2
  4785.   if (HAVE_sqrtsi2)
  4786.     sqrt_optab->handlers[(int) SImode].insn_code = CODE_FOR_sqrtsi2;
  4787. #endif
  4788. #ifdef HAVE_sqrtdi2
  4789.   if (HAVE_sqrtdi2)
  4790.     sqrt_optab->handlers[(int) DImode].insn_code = CODE_FOR_sqrtdi2;
  4791. #endif
  4792. #ifdef HAVE_sqrtti2
  4793.   if (HAVE_sqrtti2)
  4794.     sqrt_optab->handlers[(int) TImode].insn_code = CODE_FOR_sqrtti2;
  4795. #endif
  4796. #ifdef HAVE_sqrtsf2
  4797.   if (HAVE_sqrtsf2)
  4798.     sqrt_optab->handlers[(int) SFmode].insn_code = CODE_FOR_sqrtsf2;
  4799. #endif
  4800. #ifdef HAVE_sqrtdf2
  4801.   if (HAVE_sqrtdf2)
  4802.     sqrt_optab->handlers[(int) DFmode].insn_code = CODE_FOR_sqrtdf2;
  4803. #endif
  4804. #ifdef HAVE_sqrttf2
  4805.   if (HAVE_sqrttf2)
  4806.     sqrt_optab->handlers[(int) TFmode].insn_code = CODE_FOR_sqrttf2;
  4807. #endif
  4808.   /* No library calls here!  If there is no sqrt instruction expand_builtin
  4809.      should force the library call.  */
  4810.  
  4811. #ifdef HAVE_sinsf2
  4812.   if (HAVE_sinsf2)
  4813.     sin_optab->handlers[(int) SFmode].insn_code = CODE_FOR_sinsf2;
  4814. #endif
  4815. #ifdef HAVE_sindf2
  4816.   if (HAVE_sindf2)
  4817.     sin_optab->handlers[(int) DFmode].insn_code = CODE_FOR_sindf2;
  4818. #endif
  4819. #ifdef HAVE_sintf2
  4820.   if (HAVE_sintf2)
  4821.     sin_optab->handlers[(int) TFmode].insn_code = CODE_FOR_sintf2;
  4822. #endif
  4823.   /* No library calls here!  If there is no sin instruction expand_builtin
  4824.      should force the library call.  */
  4825.  
  4826. #ifdef HAVE_cossf2
  4827.   if (HAVE_cossf2)
  4828.     cos_optab->handlers[(int) SFmode].insn_code = CODE_FOR_cossf2;
  4829. #endif
  4830. #ifdef HAVE_cosdf2
  4831.   if (HAVE_cosdf2)
  4832.     cos_optab->handlers[(int) DFmode].insn_code = CODE_FOR_cosdf2;
  4833. #endif
  4834. #ifdef HAVE_costf2
  4835.   if (HAVE_costf2)
  4836.     cos_optab->handlers[(int) TFmode].insn_code = CODE_FOR_costf2;
  4837. #endif
  4838.   /* No library calls here!  If there is no cos instruction expand_builtin
  4839.      should force the library call.  */
  4840.  
  4841. #ifdef HAVE_strlenqi
  4842.   if (HAVE_strlenqi)
  4843.     strlen_optab->handlers[(int) QImode].insn_code = CODE_FOR_strlenqi;
  4844. #endif
  4845. #ifdef HAVE_strlenhi
  4846.   if (HAVE_strlenhi)
  4847.     strlen_optab->handlers[(int) HImode].insn_code = CODE_FOR_strlenhi;
  4848. #endif
  4849. #ifdef HAVE_strlenpsi
  4850.   if (HAVE_strlenpsi)
  4851.     strlen_optab->handlers[(int) PSImode].insn_code = CODE_FOR_strlenpsi;
  4852. #endif
  4853. #ifdef HAVE_strlensi
  4854.   if (HAVE_strlensi)
  4855.     strlen_optab->handlers[(int) SImode].insn_code = CODE_FOR_strlensi;
  4856. #endif
  4857. #ifdef HAVE_strlendi
  4858.   if (HAVE_strlendi)
  4859.     strlen_optab->handlers[(int) DImode].insn_code = CODE_FOR_strlendi;
  4860. #endif
  4861. #ifdef HAVE_strlenti
  4862.   if (HAVE_strlenti)
  4863.     strlen_optab->handlers[(int) TImode].insn_code = CODE_FOR_strlenti;
  4864. #endif
  4865.   /* No library calls here!  If there is no strlen instruction expand_builtin
  4866.      should force the library call.  */
  4867.  
  4868. #ifdef HAVE_one_cmplqi2
  4869.   if (HAVE_one_cmplqi2)
  4870.     one_cmpl_optab->handlers[(int) QImode].insn_code = CODE_FOR_one_cmplqi2;
  4871. #endif
  4872. #ifdef HAVE_one_cmplhi2
  4873.   if (HAVE_one_cmplhi2)
  4874.     one_cmpl_optab->handlers[(int) HImode].insn_code = CODE_FOR_one_cmplhi2;
  4875. #endif
  4876. #ifdef HAVE_one_cmplpsi2
  4877.   if (HAVE_one_cmplpsi2)
  4878.     one_cmpl_optab->handlers[(int) PSImode].insn_code = CODE_FOR_one_cmplpsi2;
  4879. #endif
  4880. #ifdef HAVE_one_cmplsi2
  4881.   if (HAVE_one_cmplsi2)
  4882.     one_cmpl_optab->handlers[(int) SImode].insn_code = CODE_FOR_one_cmplsi2;
  4883. #endif
  4884. #ifdef HAVE_one_cmpldi2
  4885.   if (HAVE_one_cmpldi2)
  4886.     one_cmpl_optab->handlers[(int) DImode].insn_code = CODE_FOR_one_cmpldi2;
  4887. #endif
  4888. #ifdef HAVE_one_cmplti2
  4889.   if (HAVE_one_cmplti2)
  4890.     one_cmpl_optab->handlers[(int) TImode].insn_code = CODE_FOR_one_cmplti2;
  4891. #endif
  4892.   init_integral_libfuncs (one_cmpl_optab, "one_cmpl", '2');
  4893.  
  4894. #ifdef HAVE_ffsqi2
  4895.   if (HAVE_ffsqi2)
  4896.     ffs_optab->handlers[(int) QImode].insn_code = CODE_FOR_ffsqi2;
  4897. #endif
  4898. #ifdef HAVE_ffshi2
  4899.   if (HAVE_ffshi2)
  4900.     ffs_optab->handlers[(int) HImode].insn_code = CODE_FOR_ffshi2;
  4901. #endif
  4902. #ifdef HAVE_ffspsi2
  4903.   if (HAVE_ffspsi2)
  4904.     ffs_optab->handlers[(int) PSImode].insn_code = CODE_FOR_ffspsi2;
  4905. #endif
  4906. #ifdef HAVE_ffssi2
  4907.   if (HAVE_ffssi2)
  4908.     ffs_optab->handlers[(int) SImode].insn_code = CODE_FOR_ffssi2;
  4909. #endif
  4910. #ifdef HAVE_ffsdi2
  4911.   if (HAVE_ffsdi2)
  4912.     ffs_optab->handlers[(int) DImode].insn_code = CODE_FOR_ffsdi2;
  4913. #endif
  4914. #ifdef HAVE_ffsti2
  4915.   if (HAVE_ffsti2)
  4916.     ffs_optab->handlers[(int) TImode].insn_code = CODE_FOR_ffsti2;
  4917. #endif
  4918.   init_integral_libfuncs (ffs_optab, "ffs", '2');
  4919.  
  4920.   /* Code generation table entries for extended float elem functions. */
  4921. #ifdef HAVE_sinxf2
  4922.   if (HAVE_sinxf2)
  4923.     sin_optab->handlers[(int) XFmode].insn_code = CODE_FOR_sinxf2;
  4924. #endif
  4925.   sin_optab->handlers[(int) XFmode].libfunc 
  4926.       = gen_rtx (SYMBOL_REF, Pmode, "__sinxf2");
  4927. #ifdef HAVE_cosxf2
  4928.   if (HAVE_cosxf2)
  4929.     cos_optab->handlers[(int) XFmode].insn_code = CODE_FOR_cosxf2;
  4930. #endif
  4931.   cos_optab->handlers[(int) XFmode].libfunc
  4932.       = gen_rtx (SYMBOL_REF, Pmode, "__cosxf2");
  4933. #ifdef HAVE_tanxf2
  4934.   if (HAVE_tanxf2)
  4935.     tan_optab->handlers[(int) XFmode].insn_code = CODE_FOR_tanxf2;
  4936. #endif
  4937.   tan_optab->handlers[(int) XFmode].libfunc
  4938.       = gen_rtx (SYMBOL_REF, Pmode, "__tanxf2");
  4939. #ifdef HAVE_asinxf2
  4940.   if (HAVE_asinxf2)
  4941.     asin_optab->handlers[(int) XFmode].insn_code = CODE_FOR_asinxf2;
  4942. #endif
  4943.   asin_optab->handlers[(int) XFmode].libfunc
  4944.       = gen_rtx (SYMBOL_REF, Pmode, "__asinxf2");
  4945. #ifdef HAVE_acosxf2
  4946.   if (HAVE_acosxf2)
  4947.     acos_optab->handlers[(int) XFmode].insn_code = CODE_FOR_acosxf2;
  4948. #endif
  4949.   acos_optab->handlers[(int) XFmode].libfunc
  4950.       = gen_rtx (SYMBOL_REF, Pmode, "__acosxf2");
  4951. #ifdef HAVE_atanxf2
  4952.   if (HAVE_atanxf2)
  4953.     atan_optab->handlers[(int) XFmode].insn_code = CODE_FOR_atanxf2;
  4954. #endif
  4955.   atan_optab->handlers[(int) XFmode].libfunc
  4956.       = gen_rtx (SYMBOL_REF, Pmode, "__atanxf2");
  4957. #ifdef HAVE_sinhxf2
  4958.   if (HAVE_sinhxf2)
  4959.     sinh_optab->handlers[(int) XFmode].insn_code = CODE_FOR_sinhxf2;
  4960. #endif
  4961.   sinh_optab->handlers[(int) XFmode].libfunc
  4962.       = gen_rtx (SYMBOL_REF, Pmode, "__sinhxf2");
  4963. #ifdef HAVE_coshxf2
  4964.   if (HAVE_coshxf2)
  4965.     cosh_optab->handlers[(int) XFmode].insn_code = CODE_FOR_coshxf2;
  4966. #endif
  4967.   cosh_optab->handlers[(int) XFmode].libfunc
  4968.       = gen_rtx (SYMBOL_REF, Pmode, "__coshxf2");
  4969. #ifdef HAVE_tanhxf2
  4970.   if (HAVE_tanhxf2)
  4971.     tanh_optab->handlers[(int) XFmode].insn_code = CODE_FOR_tanhxf2;
  4972. #endif
  4973.   tanh_optab->handlers[(int) XFmode].libfunc
  4974.       = gen_rtx (SYMBOL_REF, Pmode, "__tanhxf2");
  4975. #ifdef HAVE_expxf2
  4976.   if (HAVE_expxf2)
  4977.     exp_optab->handlers[(int) XFmode].insn_code = CODE_FOR_expxf2;
  4978. #endif
  4979.   exp_optab->handlers[(int) XFmode].libfunc
  4980.       = gen_rtx (SYMBOL_REF, Pmode, "__expxf2");
  4981. #ifdef HAVE_logxf2
  4982.   if (HAVE_logxf2)
  4983.     log_optab->handlers[(int) XFmode].insn_code = CODE_FOR_logxf2;
  4984. #endif
  4985.   log_optab->handlers[(int) XFmode].libfunc
  4986.       = gen_rtx (SYMBOL_REF, Pmode, "__logxf2");
  4987. #ifdef HAVE_log10xf2
  4988.   if (HAVE_log10xf2)
  4989.     log10_optab->handlers[(int) XFmode].insn_code = CODE_FOR_log10xf2;
  4990. #endif
  4991.   log10_optab->handlers[(int) XFmode].libfunc
  4992.       = gen_rtx (SYMBOL_REF, Pmode, "__log10xf2");
  4993. #ifdef HAVE_sqrtxf2
  4994.   if (HAVE_sqrtxf2)
  4995.     sqrt_optab->handlers[(int) XFmode].insn_code = CODE_FOR_sqrtxf2;
  4996. #endif
  4997.   sqrt_optab->handlers[(int) XFmode].libfunc
  4998.       = gen_rtx (SYMBOL_REF, Pmode, "__sqrtxf2");
  4999.  
  5000. #ifdef PTR_HACK
  5001. #ifdef HAVE_movDP
  5002.   if (HAVE_movDP)
  5003.     mov_optab->handlers[(int) DPmode].insn_code = CODE_FOR_movDP;
  5004. #endif
  5005. #ifdef HAVE_movTP
  5006.   if (HAVE_movTP)
  5007.     mov_optab->handlers[(int) TPmode].insn_code = CODE_FOR_movTP;
  5008. #endif
  5009. #endif /* PTR_HACK */
  5010.  
  5011. #ifdef HAVE_movqi
  5012.   if (HAVE_movqi)
  5013.     mov_optab->handlers[(int) QImode].insn_code = CODE_FOR_movqi;
  5014. #endif
  5015. #ifdef HAVE_movhi
  5016.   if (HAVE_movhi)
  5017.     mov_optab->handlers[(int) HImode].insn_code = CODE_FOR_movhi;
  5018. #endif
  5019. #ifdef HAVE_movpsi
  5020.   if (HAVE_movpsi)
  5021.     mov_optab->handlers[(int) PSImode].insn_code = CODE_FOR_movpsi;
  5022. #endif
  5023. #ifdef HAVE_movsi
  5024.   if (HAVE_movsi)
  5025.     mov_optab->handlers[(int) SImode].insn_code = CODE_FOR_movsi;
  5026. #endif
  5027. #ifdef HAVE_movdi
  5028.   if (HAVE_movdi)
  5029.     mov_optab->handlers[(int) DImode].insn_code = CODE_FOR_movdi;
  5030. #endif
  5031. #ifdef HAVE_movti
  5032.   if (HAVE_movti)
  5033.     mov_optab->handlers[(int) TImode].insn_code = CODE_FOR_movti;
  5034. #endif
  5035. #ifdef HAVE_movsf
  5036.   if (HAVE_movsf)
  5037.     mov_optab->handlers[(int) SFmode].insn_code = CODE_FOR_movsf;
  5038. #endif
  5039. #ifdef HAVE_movdf
  5040.   if (HAVE_movdf)
  5041.     mov_optab->handlers[(int) DFmode].insn_code = CODE_FOR_movdf;
  5042. #endif
  5043. #ifdef HAVE_movxf
  5044.   if (HAVE_movxf)
  5045.     mov_optab->handlers[(int) XFmode].insn_code = CODE_FOR_movxf;
  5046. #endif
  5047. #ifdef HAVE_movtf
  5048.   if (HAVE_movtf)
  5049.     mov_optab->handlers[(int) TFmode].insn_code = CODE_FOR_movtf;
  5050. #endif
  5051. #ifdef HAVE_movcc
  5052.   if (HAVE_movcc)
  5053.     mov_optab->handlers[(int) CCmode].insn_code = CODE_FOR_movcc;
  5054. #endif
  5055.  
  5056. #ifdef EXTRA_CC_MODES
  5057.   init_mov_optab ();
  5058. #endif
  5059.  
  5060. #ifdef HAVE_movstrictqi
  5061.   if (HAVE_movstrictqi)
  5062.     movstrict_optab->handlers[(int) QImode].insn_code = CODE_FOR_movstrictqi;
  5063. #endif
  5064. #ifdef HAVE_movstricthi
  5065.   if (HAVE_movstricthi)
  5066.     movstrict_optab->handlers[(int) HImode].insn_code = CODE_FOR_movstricthi;
  5067. #endif
  5068. #ifdef HAVE_movstrictpsi
  5069.   if (HAVE_movstrictpsi)
  5070.     movstrict_optab->handlers[(int) PSImode].insn_code = CODE_FOR_movstrictpsi;
  5071. #endif
  5072. #ifdef HAVE_movstrictsi
  5073.   if (HAVE_movstrictsi)
  5074.     movstrict_optab->handlers[(int) SImode].insn_code = CODE_FOR_movstrictsi;
  5075. #endif
  5076. #ifdef HAVE_movstrictdi
  5077.   if (HAVE_movstrictdi)
  5078.     movstrict_optab->handlers[(int) DImode].insn_code = CODE_FOR_movstrictdi;
  5079. #endif
  5080. #ifdef HAVE_movstrictti
  5081.   if (HAVE_movstrictti)
  5082.     movstrict_optab->handlers[(int) TImode].insn_code = CODE_FOR_movstrictti;
  5083. #endif
  5084.  
  5085. #ifdef PTR_HACK
  5086. #ifdef HAVE_cmpDP
  5087.   if (HAVE_cmpDP)
  5088.     cmp_optab->handlers[(int) DPmode].insn_code = CODE_FOR_cmpDP;
  5089. #endif
  5090. #ifdef HAVE_cmpTP
  5091.   if (HAVE_cmpTP)
  5092.     cmp_optab->handlers[(int) TPmode].insn_code = CODE_FOR_cmpTP;
  5093. #endif
  5094. #endif /* PTR_HACK */
  5095.  
  5096.  
  5097. #ifdef HAVE_cmpqi
  5098.   if (HAVE_cmpqi)
  5099.     cmp_optab->handlers[(int) QImode].insn_code = CODE_FOR_cmpqi;
  5100. #endif
  5101. #ifdef HAVE_cmphi
  5102.   if (HAVE_cmphi)
  5103.     cmp_optab->handlers[(int) HImode].insn_code = CODE_FOR_cmphi;
  5104. #endif
  5105. #ifdef HAVE_cmppsi
  5106.   if (HAVE_cmppsi)
  5107.     cmp_optab->handlers[(int) PSImode].insn_code = CODE_FOR_cmppsi;
  5108. #endif
  5109. #ifdef HAVE_cmpsi
  5110.   if (HAVE_cmpsi)
  5111.     cmp_optab->handlers[(int) SImode].insn_code = CODE_FOR_cmpsi;
  5112. #endif
  5113. #ifdef HAVE_cmpdi
  5114.   if (HAVE_cmpdi)
  5115.     cmp_optab->handlers[(int) DImode].insn_code = CODE_FOR_cmpdi;
  5116. #endif
  5117. #ifdef HAVE_cmpti
  5118.   if (HAVE_cmpti)
  5119.     cmp_optab->handlers[(int) TImode].insn_code = CODE_FOR_cmpti;
  5120. #endif
  5121. #ifdef HAVE_cmpsf
  5122.   if (HAVE_cmpsf)
  5123.     cmp_optab->handlers[(int) SFmode].insn_code = CODE_FOR_cmpsf;
  5124. #endif
  5125. #ifdef HAVE_cmpdf
  5126.   if (HAVE_cmpdf)
  5127.     cmp_optab->handlers[(int) DFmode].insn_code = CODE_FOR_cmpdf;
  5128. #endif
  5129. #ifdef HAVE_cmpxf
  5130.   if (HAVE_cmpxf)
  5131.     cmp_optab->handlers[(int) XFmode].insn_code = CODE_FOR_cmpxf;
  5132. #endif
  5133. #ifdef HAVE_cmptf
  5134.   if (HAVE_cmptf)
  5135.     cmp_optab->handlers[(int) TFmode].insn_code = CODE_FOR_cmptf;
  5136. #endif
  5137.   /* Comparison libcalls for integers MUST come in pairs, signed/unsigned.  */
  5138.   init_integral_libfuncs (cmp_optab, "cmp", '2');
  5139.   init_integral_libfuncs (ucmp_optab, "ucmp", '2');
  5140.   init_floating_libfuncs (cmp_optab, "cmp", '2');
  5141.  
  5142. #ifdef PTR_HACK
  5143. #ifdef HAVE_tstDP
  5144.   if (HAVE_tstDP)
  5145.     tst_optab->handlers[(int) DPmode].insn_code = CODE_FOR_tstDP;
  5146. #endif
  5147. #ifdef HAVE_tstTP
  5148.   if (HAVE_tstTP)
  5149.     tst_optab->handlers[(int) TPmode].insn_code = CODE_FOR_tstTP;
  5150. #endif
  5151. #endif /* PTR_HACK */
  5152.  
  5153.  
  5154. #ifdef HAVE_tstqi
  5155.   if (HAVE_tstqi)
  5156.     tst_optab->handlers[(int) QImode].insn_code = CODE_FOR_tstqi;
  5157. #endif
  5158. #ifdef HAVE_tsthi
  5159.   if (HAVE_tsthi)
  5160.     tst_optab->handlers[(int) HImode].insn_code = CODE_FOR_tsthi;
  5161. #endif
  5162. #ifdef HAVE_tstpsi
  5163.   if (HAVE_tstpsi)
  5164.     tst_optab->handlers[(int) PSImode].insn_code = CODE_FOR_tstpsi;
  5165. #endif
  5166. #ifdef HAVE_tstsi
  5167.   if (HAVE_tstsi)
  5168.     tst_optab->handlers[(int) SImode].insn_code = CODE_FOR_tstsi;
  5169. #endif
  5170. #ifdef HAVE_tstdi
  5171.   if (HAVE_tstdi)
  5172.     tst_optab->handlers[(int) DImode].insn_code = CODE_FOR_tstdi;
  5173. #endif
  5174. #ifdef HAVE_tstti
  5175.   if (HAVE_tstti)
  5176.     tst_optab->handlers[(int) TImode].insn_code = CODE_FOR_tstti;
  5177. #endif
  5178. #ifdef HAVE_tstsf
  5179.   if (HAVE_tstsf)
  5180.     tst_optab->handlers[(int) SFmode].insn_code = CODE_FOR_tstsf;
  5181. #endif
  5182. #ifdef HAVE_tstdf
  5183.   if (HAVE_tstdf)
  5184.     tst_optab->handlers[(int) DFmode].insn_code = CODE_FOR_tstdf;
  5185. #endif
  5186. #ifdef HAVE_tstxf
  5187.   if (HAVE_tstxf)
  5188.     tst_optab->handlers[(int) XFmode].insn_code = CODE_FOR_tstxf;
  5189. #endif
  5190. #ifdef HAVE_tsttf
  5191.   if (HAVE_tsttf)
  5192.     tst_optab->handlers[(int) TFmode].insn_code = CODE_FOR_tsttf;
  5193. #endif
  5194.  
  5195. #ifdef HAVE_beq
  5196.   if (HAVE_beq)
  5197.     bcc_gen_fctn[(int) EQ] = gen_beq;
  5198. #endif
  5199. #ifdef HAVE_bne
  5200.   if (HAVE_bne)
  5201.     bcc_gen_fctn[(int) NE] = gen_bne;
  5202. #endif
  5203. #ifdef HAVE_bgt
  5204.   if (HAVE_bgt)
  5205.     bcc_gen_fctn[(int) GT] = gen_bgt;
  5206. #endif
  5207. #ifdef HAVE_bge
  5208.   if (HAVE_bge)
  5209.     bcc_gen_fctn[(int) GE] = gen_bge;
  5210. #endif
  5211. #ifdef HAVE_bgtu
  5212.   if (HAVE_bgtu)
  5213.     bcc_gen_fctn[(int) GTU] = gen_bgtu;
  5214. #endif
  5215. #ifdef HAVE_bgeu
  5216.   if (HAVE_bgeu)
  5217.     bcc_gen_fctn[(int) GEU] = gen_bgeu;
  5218. #endif
  5219. #ifdef HAVE_blt
  5220.   if (HAVE_blt)
  5221.     bcc_gen_fctn[(int) LT] = gen_blt;
  5222. #endif
  5223. #ifdef HAVE_ble
  5224.   if (HAVE_ble)
  5225.     bcc_gen_fctn[(int) LE] = gen_ble;
  5226. #endif
  5227. #ifdef HAVE_bltu
  5228.   if (HAVE_bltu)
  5229.     bcc_gen_fctn[(int) LTU] = gen_bltu;
  5230. #endif
  5231. #ifdef HAVE_bleu
  5232.   if (HAVE_bleu)
  5233.     bcc_gen_fctn[(int) LEU] = gen_bleu;
  5234. #endif
  5235.  
  5236.   for (i = 0; i < NUM_RTX_CODE; i++)
  5237.     setcc_gen_code[i] = CODE_FOR_nothing;
  5238.  
  5239. #ifdef HAVE_seq
  5240.   if (HAVE_seq)
  5241.     setcc_gen_code[(int) EQ] = CODE_FOR_seq;
  5242. #endif
  5243. #ifdef HAVE_sne
  5244.   if (HAVE_sne)
  5245.     setcc_gen_code[(int) NE] = CODE_FOR_sne;
  5246. #endif
  5247. #ifdef HAVE_sgt
  5248.   if (HAVE_sgt)
  5249.     setcc_gen_code[(int) GT] = CODE_FOR_sgt;
  5250. #endif
  5251. #ifdef HAVE_sge
  5252.   if (HAVE_sge)
  5253.     setcc_gen_code[(int) GE] = CODE_FOR_sge;
  5254. #endif
  5255. #ifdef HAVE_sgtu
  5256.   if (HAVE_sgtu)
  5257.     setcc_gen_code[(int) GTU] = CODE_FOR_sgtu;
  5258. #endif
  5259. #ifdef HAVE_sgeu
  5260.   if (HAVE_sgeu)
  5261.     setcc_gen_code[(int) GEU] = CODE_FOR_sgeu;
  5262. #endif
  5263. #ifdef HAVE_slt
  5264.   if (HAVE_slt)
  5265.     setcc_gen_code[(int) LT] = CODE_FOR_slt;
  5266. #endif
  5267. #ifdef HAVE_sle
  5268.   if (HAVE_sle)
  5269.     setcc_gen_code[(int) LE] = CODE_FOR_sle;
  5270. #endif
  5271. #ifdef HAVE_sltu
  5272.   if (HAVE_sltu)
  5273.     setcc_gen_code[(int) LTU] = CODE_FOR_sltu;
  5274. #endif
  5275. #ifdef HAVE_sleu
  5276.   if (HAVE_sleu)
  5277.     setcc_gen_code[(int) LEU] = CODE_FOR_sleu;
  5278. #endif
  5279.  
  5280.   extendsfdf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__extendsfdf2");
  5281.   extendsfxf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__extendsfxf2");
  5282.   extendsftf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__extendsftf2");
  5283.   extenddfxf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__extenddfxf2");
  5284.   extenddftf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__extenddftf2");
  5285.  
  5286.   truncdfsf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__truncdfsf2");
  5287.   truncxfsf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__truncxfsf2");
  5288.   trunctfsf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__trunctfsf2");
  5289.   truncxfdf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__truncxfdf2");
  5290.   trunctfdf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__trunctfdf2");
  5291.  
  5292.   memcpy_libfunc = gen_rtx (SYMBOL_REF, TPmode, "memcpy");
  5293.   bcopy_libfunc = gen_rtx (SYMBOL_REF, TPmode, "bcopy");
  5294.   memcmp_libfunc = gen_rtx (SYMBOL_REF, TPmode, "memcmp");
  5295.   bcmp_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gcc_bcmp");
  5296.   memset_libfunc = gen_rtx (SYMBOL_REF, TPmode, "memset");
  5297.   bzero_libfunc = gen_rtx (SYMBOL_REF, TPmode, "bzero");
  5298.  
  5299.   eqsf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__eqsf2");
  5300.   nesf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__nesf2");
  5301.   gtsf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gtsf2");
  5302.   gesf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gesf2");
  5303.   ltsf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__ltsf2");
  5304.   lesf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__lesf2");
  5305.  
  5306.   eqdf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__eqdf2");
  5307.   nedf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__nedf2");
  5308.   gtdf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gtdf2");
  5309.   gedf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gedf2");
  5310.   ltdf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__ltdf2");
  5311.   ledf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__ledf2");
  5312.  
  5313.   eqxf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__eqxf2");
  5314.   nexf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__nexf2");
  5315.   gtxf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gtxf2");
  5316.   gexf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gexf2");
  5317.   ltxf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__ltxf2");
  5318.   lexf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__lexf2");
  5319.  
  5320.   eqtf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__eqtf2");
  5321.   netf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__netf2");
  5322.   gttf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__gttf2");
  5323.   getf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__getf2");
  5324.   lttf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__lttf2");
  5325.   letf2_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__letf2");
  5326.  
  5327.   floatsisf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatsisf");
  5328.   floatdisf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatdisf");
  5329.   floattisf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floattisf");
  5330.  
  5331.   floatsidf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatsidf");
  5332.   floatdidf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatdidf");
  5333.   floattidf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floattidf");
  5334.  
  5335.   floatsixf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatsixf");
  5336.   floatdixf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatdixf");
  5337.   floattixf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floattixf");
  5338.  
  5339.   floatsitf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatsitf");
  5340.   floatditf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floatditf");
  5341.   floattitf_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__floattitf");
  5342.  
  5343.   fixsfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixsfsi");
  5344.   fixsfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixsfdi");
  5345.   fixsfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixsfti");
  5346.  
  5347.   fixdfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixdfsi");
  5348.   fixdfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixdfdi");
  5349.   fixdfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixdfti");
  5350.  
  5351.   fixxfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixxfsi");
  5352.   fixxfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixxfdi");
  5353.   fixxfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixxfti");
  5354.  
  5355.   fixtfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixtfsi");
  5356.   fixtfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixtfdi");
  5357.   fixtfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixtfti");
  5358.  
  5359.   fixunssfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunssfsi");
  5360.   fixunssfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunssfdi");
  5361.   fixunssfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunssfti");
  5362.  
  5363.   fixunsdfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunsdfsi");
  5364.   fixunsdfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunsdfdi");
  5365.   fixunsdfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunsdfti");
  5366.  
  5367.   fixunsxfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunsxfsi");
  5368.   fixunsxfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunsxfdi");
  5369.   fixunsxfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunsxfti");
  5370.  
  5371.   fixunstfsi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunstfsi");
  5372.   fixunstfdi_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunstfdi");
  5373.   fixunstfti_libfunc = gen_rtx (SYMBOL_REF, TPmode, "__fixunstfti");
  5374. }
  5375.  
  5376. #ifdef BROKEN_LDEXP
  5377.  
  5378. /* SCO 3.2 apparently has a broken ldexp. */
  5379.  
  5380. double
  5381. ldexp(x,n)
  5382.      double x;
  5383.      int n;
  5384. {
  5385.   if (n > 0)
  5386.     while (n--)
  5387.       x *= 2;
  5388.  
  5389.   return x;
  5390. }
  5391. #endif /* BROKEN_LDEXP */
  5392.